{
  "cells": [
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "YH8iJl3qtk1a"
      },
      "source": [
        "#64-注意力机制"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "NUoif5LqtOMh"
      },
      "source": [
        "##启用GPU\n",
        "\n"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/"
        },
        "id": "slNovdubtU8A",
        "outputId": "b898f90e-3a89-4db0-a09b-e021ec110697"
      },
      "outputs": [
        {
          "name": "stdout",
          "output_type": "stream",
          "text": [
            "Found GPU at: /device:GPU:0\n"
          ]
        }
      ],
      "source": [
        "%tensorflow_version 2.x\n",
        "import tensorflow as tf\n",
        "device_name = tf.test.gpu_device_name()\n",
        "if device_name != '/device:GPU:0':\n",
        "  raise SystemError('GPU device not found')\n",
        "print('Found GPU at: {}'.format(device_name))"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "ZdGON_oxtY34"
      },
      "source": [
        "##安装pytorch和d2l"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/"
        },
        "id": "shMeiKRmtZe4",
        "outputId": "4b905b3c-59be-4c78-ab80-63e1c062bebd"
      },
      "outputs": [
        {
          "name": "stdout",
          "output_type": "stream",
          "text": [
            "Requirement already satisfied: torch in /usr/local/lib/python3.7/dist-packages (1.10.0+cu111)\n",
            "Requirement already satisfied: torchvision in /usr/local/lib/python3.7/dist-packages (0.11.1+cu111)\n",
            "Requirement already satisfied: torchaudio in /usr/local/lib/python3.7/dist-packages (0.10.0+cu111)\n",
            "Requirement already satisfied: typing-extensions in /usr/local/lib/python3.7/dist-packages (from torch) (3.10.0.2)\n",
            "Requirement already satisfied: numpy in /usr/local/lib/python3.7/dist-packages (from torchvision) (1.19.5)\n",
            "Requirement already satisfied: pillow!=8.3.0,>=5.3.0 in /usr/local/lib/python3.7/dist-packages (from torchvision) (7.1.2)\n"
          ]
        }
      ],
      "source": [
        "!pip3 install torch torchvision torchaudio"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/"
        },
        "id": "HakkP1iKtaBH",
        "outputId": "22f43a5e-b756-4b65-b11c-3a495d7a6dcf"
      },
      "outputs": [
        {
          "name": "stdout",
          "output_type": "stream",
          "text": [
            "Collecting d2l==0.14\n",
            "  Downloading d2l-0.14.0-py3-none-any.whl (48 kB)\n",
            "\u001b[K     |████████████████████████████████| 48 kB 2.7 MB/s \n",
            "\u001b[?25hRequirement already satisfied: matplotlib in /usr/local/lib/python3.7/dist-packages (from d2l==0.14) (3.2.2)\n",
            "Requirement already satisfied: pandas in /usr/local/lib/python3.7/dist-packages (from d2l==0.14) (1.3.5)\n",
            "Requirement already satisfied: numpy in /usr/local/lib/python3.7/dist-packages (from d2l==0.14) (1.19.5)\n",
            "Requirement already satisfied: jupyter in /usr/local/lib/python3.7/dist-packages (from d2l==0.14) (1.0.0)\n",
            "Requirement already satisfied: qtconsole in /usr/local/lib/python3.7/dist-packages (from jupyter->d2l==0.14) (5.2.2)\n",
            "Requirement already satisfied: jupyter-console in /usr/local/lib/python3.7/dist-packages (from jupyter->d2l==0.14) (5.2.0)\n",
            "Requirement already satisfied: ipywidgets in /usr/local/lib/python3.7/dist-packages (from jupyter->d2l==0.14) (7.6.5)\n",
            "Requirement already satisfied: nbconvert in /usr/local/lib/python3.7/dist-packages (from jupyter->d2l==0.14) (5.6.1)\n",
            "Requirement already satisfied: ipykernel in /usr/local/lib/python3.7/dist-packages (from jupyter->d2l==0.14) (4.10.1)\n",
            "Requirement already satisfied: notebook in /usr/local/lib/python3.7/dist-packages (from jupyter->d2l==0.14) (5.3.1)\n",
            "Requirement already satisfied: tornado>=4.0 in /usr/local/lib/python3.7/dist-packages (from ipykernel->jupyter->d2l==0.14) (5.1.1)\n",
            "Requirement already satisfied: ipython>=4.0.0 in /usr/local/lib/python3.7/dist-packages (from ipykernel->jupyter->d2l==0.14) (5.5.0)\n",
            "Requirement already satisfied: traitlets>=4.1.0 in /usr/local/lib/python3.7/dist-packages (from ipykernel->jupyter->d2l==0.14) (5.1.1)\n",
            "Requirement already satisfied: jupyter-client in /usr/local/lib/python3.7/dist-packages (from ipykernel->jupyter->d2l==0.14) (5.3.5)\n",
            "Requirement already satisfied: prompt-toolkit<2.0.0,>=1.0.4 in /usr/local/lib/python3.7/dist-packages (from ipython>=4.0.0->ipykernel->jupyter->d2l==0.14) (1.0.18)\n",
            "Requirement already satisfied: setuptools>=18.5 in /usr/local/lib/python3.7/dist-packages (from ipython>=4.0.0->ipykernel->jupyter->d2l==0.14) (57.4.0)\n",
            "Requirement already satisfied: simplegeneric>0.8 in /usr/local/lib/python3.7/dist-packages (from ipython>=4.0.0->ipykernel->jupyter->d2l==0.14) (0.8.1)\n",
            "Requirement already satisfied: pexpect in /usr/local/lib/python3.7/dist-packages (from ipython>=4.0.0->ipykernel->jupyter->d2l==0.14) (4.8.0)\n",
            "Requirement already satisfied: pickleshare in /usr/local/lib/python3.7/dist-packages (from ipython>=4.0.0->ipykernel->jupyter->d2l==0.14) (0.7.5)\n",
            "Requirement already satisfied: pygments in /usr/local/lib/python3.7/dist-packages (from ipython>=4.0.0->ipykernel->jupyter->d2l==0.14) (2.6.1)\n",
            "Requirement already satisfied: decorator in /usr/local/lib/python3.7/dist-packages (from ipython>=4.0.0->ipykernel->jupyter->d2l==0.14) (4.4.2)\n",
            "Requirement already satisfied: wcwidth in /usr/local/lib/python3.7/dist-packages (from prompt-toolkit<2.0.0,>=1.0.4->ipython>=4.0.0->ipykernel->jupyter->d2l==0.14) (0.2.5)\n",
            "Requirement already satisfied: six>=1.9.0 in /usr/local/lib/python3.7/dist-packages (from prompt-toolkit<2.0.0,>=1.0.4->ipython>=4.0.0->ipykernel->jupyter->d2l==0.14) (1.15.0)\n",
            "Requirement already satisfied: ipython-genutils~=0.2.0 in /usr/local/lib/python3.7/dist-packages (from ipywidgets->jupyter->d2l==0.14) (0.2.0)\n",
            "Requirement already satisfied: widgetsnbextension~=3.5.0 in /usr/local/lib/python3.7/dist-packages (from ipywidgets->jupyter->d2l==0.14) (3.5.2)\n",
            "Requirement already satisfied: jupyterlab-widgets>=1.0.0 in /usr/local/lib/python3.7/dist-packages (from ipywidgets->jupyter->d2l==0.14) (1.0.2)\n",
            "Requirement already satisfied: nbformat>=4.2.0 in /usr/local/lib/python3.7/dist-packages (from ipywidgets->jupyter->d2l==0.14) (5.1.3)\n",
            "Requirement already satisfied: jsonschema!=2.5.0,>=2.4 in /usr/local/lib/python3.7/dist-packages (from nbformat>=4.2.0->ipywidgets->jupyter->d2l==0.14) (4.3.3)\n",
            "Requirement already satisfied: jupyter-core in /usr/local/lib/python3.7/dist-packages (from nbformat>=4.2.0->ipywidgets->jupyter->d2l==0.14) (4.9.1)\n",
            "Requirement already satisfied: typing-extensions in /usr/local/lib/python3.7/dist-packages (from jsonschema!=2.5.0,>=2.4->nbformat>=4.2.0->ipywidgets->jupyter->d2l==0.14) (3.10.0.2)\n",
            "Requirement already satisfied: pyrsistent!=0.17.0,!=0.17.1,!=0.17.2,>=0.14.0 in /usr/local/lib/python3.7/dist-packages (from jsonschema!=2.5.0,>=2.4->nbformat>=4.2.0->ipywidgets->jupyter->d2l==0.14) (0.18.1)\n",
            "Requirement already satisfied: importlib-metadata in /usr/local/lib/python3.7/dist-packages (from jsonschema!=2.5.0,>=2.4->nbformat>=4.2.0->ipywidgets->jupyter->d2l==0.14) (4.10.1)\n",
            "Requirement already satisfied: attrs>=17.4.0 in /usr/local/lib/python3.7/dist-packages (from jsonschema!=2.5.0,>=2.4->nbformat>=4.2.0->ipywidgets->jupyter->d2l==0.14) (21.4.0)\n",
            "Requirement already satisfied: importlib-resources>=1.4.0 in /usr/local/lib/python3.7/dist-packages (from jsonschema!=2.5.0,>=2.4->nbformat>=4.2.0->ipywidgets->jupyter->d2l==0.14) (5.4.0)\n",
            "Requirement already satisfied: zipp>=3.1.0 in /usr/local/lib/python3.7/dist-packages (from importlib-resources>=1.4.0->jsonschema!=2.5.0,>=2.4->nbformat>=4.2.0->ipywidgets->jupyter->d2l==0.14) (3.7.0)\n",
            "Requirement already satisfied: Send2Trash in /usr/local/lib/python3.7/dist-packages (from notebook->jupyter->d2l==0.14) (1.8.0)\n",
            "Requirement already satisfied: terminado>=0.8.1 in /usr/local/lib/python3.7/dist-packages (from notebook->jupyter->d2l==0.14) (0.13.1)\n",
            "Requirement already satisfied: jinja2 in /usr/local/lib/python3.7/dist-packages (from notebook->jupyter->d2l==0.14) (2.11.3)\n",
            "Requirement already satisfied: python-dateutil>=2.1 in /usr/local/lib/python3.7/dist-packages (from jupyter-client->ipykernel->jupyter->d2l==0.14) (2.8.2)\n",
            "Requirement already satisfied: pyzmq>=13 in /usr/local/lib/python3.7/dist-packages (from jupyter-client->ipykernel->jupyter->d2l==0.14) (22.3.0)\n",
            "Requirement already satisfied: ptyprocess in /usr/local/lib/python3.7/dist-packages (from terminado>=0.8.1->notebook->jupyter->d2l==0.14) (0.7.0)\n",
            "Requirement already satisfied: MarkupSafe>=0.23 in /usr/local/lib/python3.7/dist-packages (from jinja2->notebook->jupyter->d2l==0.14) (2.0.1)\n",
            "Requirement already satisfied: kiwisolver>=1.0.1 in /usr/local/lib/python3.7/dist-packages (from matplotlib->d2l==0.14) (1.3.2)\n",
            "Requirement already satisfied: cycler>=0.10 in /usr/local/lib/python3.7/dist-packages (from matplotlib->d2l==0.14) (0.11.0)\n",
            "Requirement already satisfied: pyparsing!=2.0.4,!=2.1.2,!=2.1.6,>=2.0.1 in /usr/local/lib/python3.7/dist-packages (from matplotlib->d2l==0.14) (3.0.7)\n",
            "Requirement already satisfied: mistune<2,>=0.8.1 in /usr/local/lib/python3.7/dist-packages (from nbconvert->jupyter->d2l==0.14) (0.8.4)\n",
            "Requirement already satisfied: entrypoints>=0.2.2 in /usr/local/lib/python3.7/dist-packages (from nbconvert->jupyter->d2l==0.14) (0.4)\n",
            "Requirement already satisfied: defusedxml in /usr/local/lib/python3.7/dist-packages (from nbconvert->jupyter->d2l==0.14) (0.7.1)\n",
            "Requirement already satisfied: testpath in /usr/local/lib/python3.7/dist-packages (from nbconvert->jupyter->d2l==0.14) (0.5.0)\n",
            "Requirement already satisfied: pandocfilters>=1.4.1 in /usr/local/lib/python3.7/dist-packages (from nbconvert->jupyter->d2l==0.14) (1.5.0)\n",
            "Requirement already satisfied: bleach in /usr/local/lib/python3.7/dist-packages (from nbconvert->jupyter->d2l==0.14) (4.1.0)\n",
            "Requirement already satisfied: webencodings in /usr/local/lib/python3.7/dist-packages (from bleach->nbconvert->jupyter->d2l==0.14) (0.5.1)\n",
            "Requirement already satisfied: packaging in /usr/local/lib/python3.7/dist-packages (from bleach->nbconvert->jupyter->d2l==0.14) (21.3)\n",
            "Requirement already satisfied: pytz>=2017.3 in /usr/local/lib/python3.7/dist-packages (from pandas->d2l==0.14) (2018.9)\n",
            "Requirement already satisfied: qtpy in /usr/local/lib/python3.7/dist-packages (from qtconsole->jupyter->d2l==0.14) (2.0.1)\n",
            "Installing collected packages: d2l\n",
            "Successfully installed d2l-0.14.0\n"
          ]
        }
      ],
      "source": [
        "!pip3 install d2l==0.14"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "853xPsHhptNV"
      },
      "source": [
        "###注意力的可视化\n",
        "\n",
        "\n"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "id": "K7eqrHFes6-W"
      },
      "outputs": [],
      "source": [
        "import torch\n",
        "from d2l import torch as d2l"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "UeJD_VVb3azN"
      },
      "source": [
        "\n",
        "\n",
        "*   可视化注意力的权重[0,1]\n",
        "*   输入matrices的形状：要显示的行数，要显示的列数，查询的数目，键的数目\n",
        "\n"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "id": "OoBxfYpFuC1u"
      },
      "outputs": [],
      "source": [
        "def show_heatmaps(matrices, xlabel, ylabel, titles=None, figsize=(2.5, 2.5),\n",
        "                  cmap='Reds'):\n",
        "    \"\"\"显示矩阵热图\"\"\"\n",
        "    d2l.use_svg_display()\n",
        "    num_rows, num_cols = matrices.shape[0], matrices.shape[1]\n",
        "    fig, axes = d2l.plt.subplots(num_rows, num_cols, figsize=figsize,\n",
        "                                 sharex=True, sharey=True, squeeze=False)\n",
        "    for i, (row_axes, row_matrices) in enumerate(zip(axes, matrices)):\n",
        "        for j, (ax, matrix) in enumerate(zip(row_axes, row_matrices)):\n",
        "            pcm = ax.imshow(matrix.detach().numpy(), cmap=cmap)\n",
        "            if i == num_rows - 1:\n",
        "                ax.set_xlabel(xlabel)\n",
        "            if j == 0:\n",
        "                ax.set_ylabel(ylabel)\n",
        "            if titles:\n",
        "                ax.set_title(titles[j])\n",
        "    fig.colorbar(pcm, ax=axes, shrink=0.6)"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "1XXPEZ8iwOQL"
      },
      "source": [
        "概率矩阵演示。仅当查询和键相同时，注意力权重为1，否则为0\n",
        "\n",
        "\n"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 229
        },
        "id": "MIdsrzecwLAO",
        "outputId": "1357ccb1-b285-4e8f-e711-aba6b6864113"
      },
      "outputs": [
        {
          "data": {
            "image/svg+xml": "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"no\"?>\n<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\"\n  \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">\n<!-- Created with matplotlib (https://matplotlib.org/) -->\n<svg height=\"156.35625pt\" version=\"1.1\" viewBox=\"0 0 193.35825 156.35625\" width=\"193.35825pt\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n <defs>\n  <style type=\"text/css\">\n*{stroke-linecap:butt;stroke-linejoin:round;}\n  </style>\n </defs>\n <g id=\"figure_1\">\n  <g id=\"patch_1\">\n   <path d=\"M -0 156.35625 \nL 193.35825 156.35625 \nL 193.35825 0 \nL -0 0 \nz\n\" style=\"fill:none;\"/>\n  </g>\n  <g id=\"axes_1\">\n   <g id=\"patch_2\">\n    <path d=\"M 34.240625 118.8 \nL 145.840625 118.8 \nL 145.840625 7.2 \nL 34.240625 7.2 \nz\n\" style=\"fill:#ffffff;\"/>\n   </g>\n   <g clip-path=\"url(#p5fd74f4cc7)\">\n    <image height=\"112\" id=\"imagee332bf56e8\" transform=\"scale(1 -1)translate(0 -112)\" width=\"112\" x=\"34.240625\" xlink:href=\"data:image/png;base64,\niVBORw0KGgoAAAANSUhEUgAAAHAAAABwCAYAAADG4PRLAAAABHNCSVQICAgIfAhkiAAAAXNJREFUeJzt3bFtwlAYRlET0SUjZD8YKQNmABpqp6X0QzJ515xTu7B09TefLPm03m/rwlSun9+bn/3Y8T14AQHjBIwTME7AOAHjBIwTME7AOAHjzv/9Au9iZB77uf9uftYFxgkYJ2CcgHECxgkYJ2CcgHECxgkYZ0p70sg0tixj89gIFxgnYJyAcQLGCRgnYJyAcQLGCRgnYJyAcbbQB3t9+rcnFxgnYJyAcQLGCRgnYJyAcQLGCRgnYNzhp7TiPDbCBcYJGCdgnIBxAsYJGCdgnIBxAsYJGJec0o4+j41wgXECxgkYJ2CcgHECxgkYJ2CcgHECxk0zpZnHnuMC4wSMEzBOwDgB4wSMEzBOwDgB4wSM221Km+W/CkfnAuMEjBMwTsA4AeMEjBMwTsA4AeMEjBMwbmgL9enffFxgnIBxAsYJGCdgnIBxAsYJGCdgnIBxp8vytW592Dw2HxcYJ2CcgHECxgkYJ2CcgHECxgkYJ2DcH5BIIUQIimXQAAAAAElFTkSuQmCC\" y=\"-6.8\"/>\n   </g>\n   <g id=\"matplotlib.axis_1\">\n    <g id=\"xtick_1\">\n     <g id=\"line2d_1\">\n      <defs>\n       <path d=\"M 0 0 \nL 0 3.5 \n\" id=\"m4f74c2cc08\" style=\"stroke:#000000;stroke-width:0.8;\"/>\n      </defs>\n      <g>\n       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"39.820625\" xlink:href=\"#m4f74c2cc08\" y=\"118.8\"/>\n      </g>\n     </g>\n     <g id=\"text_1\">\n      <!-- 0 -->\n      <defs>\n       <path d=\"M 31.78125 66.40625 \nQ 24.171875 66.40625 20.328125 58.90625 \nQ 16.5 51.421875 16.5 36.375 \nQ 16.5 21.390625 20.328125 13.890625 \nQ 24.171875 6.390625 31.78125 6.390625 \nQ 39.453125 6.390625 43.28125 13.890625 \nQ 47.125 21.390625 47.125 36.375 \nQ 47.125 51.421875 43.28125 58.90625 \nQ 39.453125 66.40625 31.78125 66.40625 \nz\nM 31.78125 74.21875 \nQ 44.046875 74.21875 50.515625 64.515625 \nQ 56.984375 54.828125 56.984375 36.375 \nQ 56.984375 17.96875 50.515625 8.265625 \nQ 44.046875 -1.421875 31.78125 -1.421875 \nQ 19.53125 -1.421875 13.0625 8.265625 \nQ 6.59375 17.96875 6.59375 36.375 \nQ 6.59375 54.828125 13.0625 64.515625 \nQ 19.53125 74.21875 31.78125 74.21875 \nz\n\" id=\"DejaVuSans-48\"/>\n      </defs>\n      <g transform=\"translate(36.639375 133.398438)scale(0.1 -0.1)\">\n       <use xlink:href=\"#DejaVuSans-48\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"xtick_2\">\n     <g id=\"line2d_2\">\n      <g>\n       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"95.620625\" xlink:href=\"#m4f74c2cc08\" y=\"118.8\"/>\n      </g>\n     </g>\n     <g id=\"text_2\">\n      <!-- 5 -->\n      <defs>\n       <path d=\"M 10.796875 72.90625 \nL 49.515625 72.90625 \nL 49.515625 64.59375 \nL 19.828125 64.59375 \nL 19.828125 46.734375 \nQ 21.96875 47.46875 24.109375 47.828125 \nQ 26.265625 48.1875 28.421875 48.1875 \nQ 40.625 48.1875 47.75 41.5 \nQ 54.890625 34.8125 54.890625 23.390625 \nQ 54.890625 11.625 47.5625 5.09375 \nQ 40.234375 -1.421875 26.90625 -1.421875 \nQ 22.3125 -1.421875 17.546875 -0.640625 \nQ 12.796875 0.140625 7.71875 1.703125 \nL 7.71875 11.625 \nQ 12.109375 9.234375 16.796875 8.0625 \nQ 21.484375 6.890625 26.703125 6.890625 \nQ 35.15625 6.890625 40.078125 11.328125 \nQ 45.015625 15.765625 45.015625 23.390625 \nQ 45.015625 31 40.078125 35.4375 \nQ 35.15625 39.890625 26.703125 39.890625 \nQ 22.75 39.890625 18.8125 39.015625 \nQ 14.890625 38.140625 10.796875 36.28125 \nz\n\" id=\"DejaVuSans-53\"/>\n      </defs>\n      <g transform=\"translate(92.439375 133.398438)scale(0.1 -0.1)\">\n       <use xlink:href=\"#DejaVuSans-53\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"text_3\">\n     <!-- Keys -->\n     <defs>\n      <path d=\"M 9.8125 72.90625 \nL 19.671875 72.90625 \nL 19.671875 42.09375 \nL 52.390625 72.90625 \nL 65.09375 72.90625 \nL 28.90625 38.921875 \nL 67.671875 0 \nL 54.6875 0 \nL 19.671875 35.109375 \nL 19.671875 0 \nL 9.8125 0 \nz\n\" id=\"DejaVuSans-75\"/>\n      <path d=\"M 56.203125 29.59375 \nL 56.203125 25.203125 \nL 14.890625 25.203125 \nQ 15.484375 15.921875 20.484375 11.0625 \nQ 25.484375 6.203125 34.421875 6.203125 \nQ 39.59375 6.203125 44.453125 7.46875 \nQ 49.3125 8.734375 54.109375 11.28125 \nL 54.109375 2.78125 \nQ 49.265625 0.734375 44.1875 -0.34375 \nQ 39.109375 -1.421875 33.890625 -1.421875 \nQ 20.796875 -1.421875 13.15625 6.1875 \nQ 5.515625 13.8125 5.515625 26.8125 \nQ 5.515625 40.234375 12.765625 48.109375 \nQ 20.015625 56 32.328125 56 \nQ 43.359375 56 49.78125 48.890625 \nQ 56.203125 41.796875 56.203125 29.59375 \nz\nM 47.21875 32.234375 \nQ 47.125 39.59375 43.09375 43.984375 \nQ 39.0625 48.390625 32.421875 48.390625 \nQ 24.90625 48.390625 20.390625 44.140625 \nQ 15.875 39.890625 15.1875 32.171875 \nz\n\" id=\"DejaVuSans-101\"/>\n      <path d=\"M 32.171875 -5.078125 \nQ 28.375 -14.84375 24.75 -17.8125 \nQ 21.140625 -20.796875 15.09375 -20.796875 \nL 7.90625 -20.796875 \nL 7.90625 -13.28125 \nL 13.1875 -13.28125 \nQ 16.890625 -13.28125 18.9375 -11.515625 \nQ 21 -9.765625 23.484375 -3.21875 \nL 25.09375 0.875 \nL 2.984375 54.6875 \nL 12.5 54.6875 \nL 29.59375 11.921875 \nL 46.6875 54.6875 \nL 56.203125 54.6875 \nz\n\" id=\"DejaVuSans-121\"/>\n      <path d=\"M 44.28125 53.078125 \nL 44.28125 44.578125 \nQ 40.484375 46.53125 36.375 47.5 \nQ 32.28125 48.484375 27.875 48.484375 \nQ 21.1875 48.484375 17.84375 46.4375 \nQ 14.5 44.390625 14.5 40.28125 \nQ 14.5 37.15625 16.890625 35.375 \nQ 19.28125 33.59375 26.515625 31.984375 \nL 29.59375 31.296875 \nQ 39.15625 29.25 43.1875 25.515625 \nQ 47.21875 21.78125 47.21875 15.09375 \nQ 47.21875 7.46875 41.1875 3.015625 \nQ 35.15625 -1.421875 24.609375 -1.421875 \nQ 20.21875 -1.421875 15.453125 -0.5625 \nQ 10.6875 0.296875 5.421875 2 \nL 5.421875 11.28125 \nQ 10.40625 8.6875 15.234375 7.390625 \nQ 20.0625 6.109375 24.8125 6.109375 \nQ 31.15625 6.109375 34.5625 8.28125 \nQ 37.984375 10.453125 37.984375 14.40625 \nQ 37.984375 18.0625 35.515625 20.015625 \nQ 33.0625 21.96875 24.703125 23.78125 \nL 21.578125 24.515625 \nQ 13.234375 26.265625 9.515625 29.90625 \nQ 5.8125 33.546875 5.8125 39.890625 \nQ 5.8125 47.609375 11.28125 51.796875 \nQ 16.75 56 26.8125 56 \nQ 31.78125 56 36.171875 55.265625 \nQ 40.578125 54.546875 44.28125 53.078125 \nz\n\" id=\"DejaVuSans-115\"/>\n     </defs>\n     <g transform=\"translate(78.371094 147.076563)scale(0.1 -0.1)\">\n      <use xlink:href=\"#DejaVuSans-75\"/>\n      <use x=\"60.576172\" xlink:href=\"#DejaVuSans-101\"/>\n      <use x=\"122.099609\" xlink:href=\"#DejaVuSans-121\"/>\n      <use x=\"181.279297\" xlink:href=\"#DejaVuSans-115\"/>\n     </g>\n    </g>\n   </g>\n   <g id=\"matplotlib.axis_2\">\n    <g id=\"ytick_1\">\n     <g id=\"line2d_3\">\n      <defs>\n       <path d=\"M 0 0 \nL -3.5 0 \n\" id=\"m7ddc46ee4f\" style=\"stroke:#000000;stroke-width:0.8;\"/>\n      </defs>\n      <g>\n       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"34.240625\" xlink:href=\"#m7ddc46ee4f\" y=\"12.78\"/>\n      </g>\n     </g>\n     <g id=\"text_4\">\n      <!-- 0 -->\n      <g transform=\"translate(20.878125 16.579219)scale(0.1 -0.1)\">\n       <use xlink:href=\"#DejaVuSans-48\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"ytick_2\">\n     <g id=\"line2d_4\">\n      <g>\n       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"34.240625\" xlink:href=\"#m7ddc46ee4f\" y=\"35.1\"/>\n      </g>\n     </g>\n     <g id=\"text_5\">\n      <!-- 2 -->\n      <defs>\n       <path d=\"M 19.1875 8.296875 \nL 53.609375 8.296875 \nL 53.609375 0 \nL 7.328125 0 \nL 7.328125 8.296875 \nQ 12.9375 14.109375 22.625 23.890625 \nQ 32.328125 33.6875 34.8125 36.53125 \nQ 39.546875 41.84375 41.421875 45.53125 \nQ 43.3125 49.21875 43.3125 52.78125 \nQ 43.3125 58.59375 39.234375 62.25 \nQ 35.15625 65.921875 28.609375 65.921875 \nQ 23.96875 65.921875 18.8125 64.3125 \nQ 13.671875 62.703125 7.8125 59.421875 \nL 7.8125 69.390625 \nQ 13.765625 71.78125 18.9375 73 \nQ 24.125 74.21875 28.421875 74.21875 \nQ 39.75 74.21875 46.484375 68.546875 \nQ 53.21875 62.890625 53.21875 53.421875 \nQ 53.21875 48.921875 51.53125 44.890625 \nQ 49.859375 40.875 45.40625 35.40625 \nQ 44.1875 33.984375 37.640625 27.21875 \nQ 31.109375 20.453125 19.1875 8.296875 \nz\n\" id=\"DejaVuSans-50\"/>\n      </defs>\n      <g transform=\"translate(20.878125 38.899219)scale(0.1 -0.1)\">\n       <use xlink:href=\"#DejaVuSans-50\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"ytick_3\">\n     <g id=\"line2d_5\">\n      <g>\n       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"34.240625\" xlink:href=\"#m7ddc46ee4f\" y=\"57.42\"/>\n      </g>\n     </g>\n     <g id=\"text_6\">\n      <!-- 4 -->\n      <defs>\n       <path d=\"M 37.796875 64.3125 \nL 12.890625 25.390625 \nL 37.796875 25.390625 \nz\nM 35.203125 72.90625 \nL 47.609375 72.90625 \nL 47.609375 25.390625 \nL 58.015625 25.390625 \nL 58.015625 17.1875 \nL 47.609375 17.1875 \nL 47.609375 0 \nL 37.796875 0 \nL 37.796875 17.1875 \nL 4.890625 17.1875 \nL 4.890625 26.703125 \nz\n\" id=\"DejaVuSans-52\"/>\n      </defs>\n      <g transform=\"translate(20.878125 61.219219)scale(0.1 -0.1)\">\n       <use xlink:href=\"#DejaVuSans-52\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"ytick_4\">\n     <g id=\"line2d_6\">\n      <g>\n       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"34.240625\" xlink:href=\"#m7ddc46ee4f\" y=\"79.74\"/>\n      </g>\n     </g>\n     <g id=\"text_7\">\n      <!-- 6 -->\n      <defs>\n       <path d=\"M 33.015625 40.375 \nQ 26.375 40.375 22.484375 35.828125 \nQ 18.609375 31.296875 18.609375 23.390625 \nQ 18.609375 15.53125 22.484375 10.953125 \nQ 26.375 6.390625 33.015625 6.390625 \nQ 39.65625 6.390625 43.53125 10.953125 \nQ 47.40625 15.53125 47.40625 23.390625 \nQ 47.40625 31.296875 43.53125 35.828125 \nQ 39.65625 40.375 33.015625 40.375 \nz\nM 52.59375 71.296875 \nL 52.59375 62.3125 \nQ 48.875 64.0625 45.09375 64.984375 \nQ 41.3125 65.921875 37.59375 65.921875 \nQ 27.828125 65.921875 22.671875 59.328125 \nQ 17.53125 52.734375 16.796875 39.40625 \nQ 19.671875 43.65625 24.015625 45.921875 \nQ 28.375 48.1875 33.59375 48.1875 \nQ 44.578125 48.1875 50.953125 41.515625 \nQ 57.328125 34.859375 57.328125 23.390625 \nQ 57.328125 12.15625 50.6875 5.359375 \nQ 44.046875 -1.421875 33.015625 -1.421875 \nQ 20.359375 -1.421875 13.671875 8.265625 \nQ 6.984375 17.96875 6.984375 36.375 \nQ 6.984375 53.65625 15.1875 63.9375 \nQ 23.390625 74.21875 37.203125 74.21875 \nQ 40.921875 74.21875 44.703125 73.484375 \nQ 48.484375 72.75 52.59375 71.296875 \nz\n\" id=\"DejaVuSans-54\"/>\n      </defs>\n      <g transform=\"translate(20.878125 83.539219)scale(0.1 -0.1)\">\n       <use xlink:href=\"#DejaVuSans-54\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"ytick_5\">\n     <g id=\"line2d_7\">\n      <g>\n       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"34.240625\" xlink:href=\"#m7ddc46ee4f\" y=\"102.06\"/>\n      </g>\n     </g>\n     <g id=\"text_8\">\n      <!-- 8 -->\n      <defs>\n       <path d=\"M 31.78125 34.625 \nQ 24.75 34.625 20.71875 30.859375 \nQ 16.703125 27.09375 16.703125 20.515625 \nQ 16.703125 13.921875 20.71875 10.15625 \nQ 24.75 6.390625 31.78125 6.390625 \nQ 38.8125 6.390625 42.859375 10.171875 \nQ 46.921875 13.96875 46.921875 20.515625 \nQ 46.921875 27.09375 42.890625 30.859375 \nQ 38.875 34.625 31.78125 34.625 \nz\nM 21.921875 38.8125 \nQ 15.578125 40.375 12.03125 44.71875 \nQ 8.5 49.078125 8.5 55.328125 \nQ 8.5 64.0625 14.71875 69.140625 \nQ 20.953125 74.21875 31.78125 74.21875 \nQ 42.671875 74.21875 48.875 69.140625 \nQ 55.078125 64.0625 55.078125 55.328125 \nQ 55.078125 49.078125 51.53125 44.71875 \nQ 48 40.375 41.703125 38.8125 \nQ 48.828125 37.15625 52.796875 32.3125 \nQ 56.78125 27.484375 56.78125 20.515625 \nQ 56.78125 9.90625 50.3125 4.234375 \nQ 43.84375 -1.421875 31.78125 -1.421875 \nQ 19.734375 -1.421875 13.25 4.234375 \nQ 6.78125 9.90625 6.78125 20.515625 \nQ 6.78125 27.484375 10.78125 32.3125 \nQ 14.796875 37.15625 21.921875 38.8125 \nz\nM 18.3125 54.390625 \nQ 18.3125 48.734375 21.84375 45.5625 \nQ 25.390625 42.390625 31.78125 42.390625 \nQ 38.140625 42.390625 41.71875 45.5625 \nQ 45.3125 48.734375 45.3125 54.390625 \nQ 45.3125 60.0625 41.71875 63.234375 \nQ 38.140625 66.40625 31.78125 66.40625 \nQ 25.390625 66.40625 21.84375 63.234375 \nQ 18.3125 60.0625 18.3125 54.390625 \nz\n\" id=\"DejaVuSans-56\"/>\n      </defs>\n      <g transform=\"translate(20.878125 105.859219)scale(0.1 -0.1)\">\n       <use xlink:href=\"#DejaVuSans-56\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"text_9\">\n     <!-- Queries -->\n     <defs>\n      <path d=\"M 39.40625 66.21875 \nQ 28.65625 66.21875 22.328125 58.203125 \nQ 16.015625 50.203125 16.015625 36.375 \nQ 16.015625 22.609375 22.328125 14.59375 \nQ 28.65625 6.59375 39.40625 6.59375 \nQ 50.140625 6.59375 56.421875 14.59375 \nQ 62.703125 22.609375 62.703125 36.375 \nQ 62.703125 50.203125 56.421875 58.203125 \nQ 50.140625 66.21875 39.40625 66.21875 \nz\nM 53.21875 1.3125 \nL 66.21875 -12.890625 \nL 54.296875 -12.890625 \nL 43.5 -1.21875 \nQ 41.890625 -1.3125 41.03125 -1.359375 \nQ 40.1875 -1.421875 39.40625 -1.421875 \nQ 24.03125 -1.421875 14.8125 8.859375 \nQ 5.609375 19.140625 5.609375 36.375 \nQ 5.609375 53.65625 14.8125 63.9375 \nQ 24.03125 74.21875 39.40625 74.21875 \nQ 54.734375 74.21875 63.90625 63.9375 \nQ 73.09375 53.65625 73.09375 36.375 \nQ 73.09375 23.6875 67.984375 14.640625 \nQ 62.890625 5.609375 53.21875 1.3125 \nz\n\" id=\"DejaVuSans-81\"/>\n      <path d=\"M 8.5 21.578125 \nL 8.5 54.6875 \nL 17.484375 54.6875 \nL 17.484375 21.921875 \nQ 17.484375 14.15625 20.5 10.265625 \nQ 23.53125 6.390625 29.59375 6.390625 \nQ 36.859375 6.390625 41.078125 11.03125 \nQ 45.3125 15.671875 45.3125 23.6875 \nL 45.3125 54.6875 \nL 54.296875 54.6875 \nL 54.296875 0 \nL 45.3125 0 \nL 45.3125 8.40625 \nQ 42.046875 3.421875 37.71875 1 \nQ 33.40625 -1.421875 27.6875 -1.421875 \nQ 18.265625 -1.421875 13.375 4.4375 \nQ 8.5 10.296875 8.5 21.578125 \nz\nM 31.109375 56 \nz\n\" id=\"DejaVuSans-117\"/>\n      <path d=\"M 41.109375 46.296875 \nQ 39.59375 47.171875 37.8125 47.578125 \nQ 36.03125 48 33.890625 48 \nQ 26.265625 48 22.1875 43.046875 \nQ 18.109375 38.09375 18.109375 28.8125 \nL 18.109375 0 \nL 9.078125 0 \nL 9.078125 54.6875 \nL 18.109375 54.6875 \nL 18.109375 46.1875 \nQ 20.953125 51.171875 25.484375 53.578125 \nQ 30.03125 56 36.53125 56 \nQ 37.453125 56 38.578125 55.875 \nQ 39.703125 55.765625 41.0625 55.515625 \nz\n\" id=\"DejaVuSans-114\"/>\n      <path d=\"M 9.421875 54.6875 \nL 18.40625 54.6875 \nL 18.40625 0 \nL 9.421875 0 \nz\nM 9.421875 75.984375 \nL 18.40625 75.984375 \nL 18.40625 64.59375 \nL 9.421875 64.59375 \nz\n\" id=\"DejaVuSans-105\"/>\n     </defs>\n     <g transform=\"translate(14.798437 82.307031)rotate(-90)scale(0.1 -0.1)\">\n      <use xlink:href=\"#DejaVuSans-81\"/>\n      <use x=\"78.710938\" xlink:href=\"#DejaVuSans-117\"/>\n      <use x=\"142.089844\" xlink:href=\"#DejaVuSans-101\"/>\n      <use x=\"203.613281\" xlink:href=\"#DejaVuSans-114\"/>\n      <use x=\"244.726562\" xlink:href=\"#DejaVuSans-105\"/>\n      <use x=\"272.509766\" xlink:href=\"#DejaVuSans-101\"/>\n      <use x=\"334.033203\" xlink:href=\"#DejaVuSans-115\"/>\n     </g>\n    </g>\n   </g>\n   <g id=\"patch_3\">\n    <path d=\"M 34.240625 118.8 \nL 34.240625 7.2 \n\" style=\"fill:none;stroke:#000000;stroke-linecap:square;stroke-linejoin:miter;stroke-width:0.8;\"/>\n   </g>\n   <g id=\"patch_4\">\n    <path d=\"M 145.840625 118.8 \nL 145.840625 7.2 \n\" style=\"fill:none;stroke:#000000;stroke-linecap:square;stroke-linejoin:miter;stroke-width:0.8;\"/>\n   </g>\n   <g id=\"patch_5\">\n    <path d=\"M 34.240625 118.8 \nL 145.840625 118.8 \n\" style=\"fill:none;stroke:#000000;stroke-linecap:square;stroke-linejoin:miter;stroke-width:0.8;\"/>\n   </g>\n   <g id=\"patch_6\">\n    <path d=\"M 34.240625 7.2 \nL 145.840625 7.2 \n\" style=\"fill:none;stroke:#000000;stroke-linecap:square;stroke-linejoin:miter;stroke-width:0.8;\"/>\n   </g>\n  </g>\n  <g id=\"axes_2\">\n   <g id=\"patch_7\">\n    <path clip-path=\"url(#p39af209151)\" d=\"M 152.815625 103.77 \nL 152.815625 103.451484 \nL 152.815625 22.548516 \nL 152.815625 22.23 \nL 156.892625 22.23 \nL 156.892625 22.548516 \nL 156.892625 103.451484 \nL 156.892625 103.77 \nz\n\" style=\"fill:#ffffff;stroke:#ffffff;stroke-linejoin:miter;stroke-width:0.01;\"/>\n   </g>\n   <image height=\"81\" id=\"image7f1a0aac31\" transform=\"scale(1 -1)translate(0 -81)\" width=\"4\" x=\"153\" xlink:href=\"data:image/png;base64,\niVBORw0KGgoAAAANSUhEUgAAAAQAAABRCAYAAAD1sgc6AAAABHNCSVQICAgIfAhkiAAAAJxJREFUOI2dkjsOwlAQAx8S9z8pFRXslxbGkSyRcjS2N1Fu+3zs+XruZ/oADAGM1UiZiC9VUAnQWNl8G8N3iLHNSEkk3IpGvEEgdwRn/dv6FQ9SPiF/hz9K2SHGBkFxNuUOBybHGFpq7+hCaff+gmoaBUMiKaUExUjblRpGlrMERYDVC0MjRwzXIXcET78wUBpiELyklCB4qdzB0g/+a8q1SIPaUQAAAABJRU5ErkJggg==\" y=\"-22\"/>\n   <g id=\"matplotlib.axis_3\"/>\n   <g id=\"matplotlib.axis_4\">\n    <g id=\"ytick_6\">\n     <g id=\"line2d_8\">\n      <defs>\n       <path d=\"M 0 0 \nL 3.5 0 \n\" id=\"m43e3cfbb5f\" style=\"stroke:#000000;stroke-width:0.8;\"/>\n      </defs>\n      <g>\n       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"156.892625\" xlink:href=\"#m43e3cfbb5f\" y=\"103.77\"/>\n      </g>\n     </g>\n     <g id=\"text_10\">\n      <!-- 0.00 -->\n      <defs>\n       <path d=\"M 10.6875 12.40625 \nL 21 12.40625 \nL 21 0 \nL 10.6875 0 \nz\n\" id=\"DejaVuSans-46\"/>\n      </defs>\n      <g transform=\"translate(163.892625 107.569219)scale(0.1 -0.1)\">\n       <use xlink:href=\"#DejaVuSans-48\"/>\n       <use x=\"63.623047\" xlink:href=\"#DejaVuSans-46\"/>\n       <use x=\"95.410156\" xlink:href=\"#DejaVuSans-48\"/>\n       <use x=\"159.033203\" xlink:href=\"#DejaVuSans-48\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"ytick_7\">\n     <g id=\"line2d_9\">\n      <g>\n       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"156.892625\" xlink:href=\"#m43e3cfbb5f\" y=\"83.385\"/>\n      </g>\n     </g>\n     <g id=\"text_11\">\n      <!-- 0.25 -->\n      <g transform=\"translate(163.892625 87.184219)scale(0.1 -0.1)\">\n       <use xlink:href=\"#DejaVuSans-48\"/>\n       <use x=\"63.623047\" xlink:href=\"#DejaVuSans-46\"/>\n       <use x=\"95.410156\" xlink:href=\"#DejaVuSans-50\"/>\n       <use x=\"159.033203\" xlink:href=\"#DejaVuSans-53\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"ytick_8\">\n     <g id=\"line2d_10\">\n      <g>\n       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"156.892625\" xlink:href=\"#m43e3cfbb5f\" y=\"63\"/>\n      </g>\n     </g>\n     <g id=\"text_12\">\n      <!-- 0.50 -->\n      <g transform=\"translate(163.892625 66.799219)scale(0.1 -0.1)\">\n       <use xlink:href=\"#DejaVuSans-48\"/>\n       <use x=\"63.623047\" xlink:href=\"#DejaVuSans-46\"/>\n       <use x=\"95.410156\" xlink:href=\"#DejaVuSans-53\"/>\n       <use x=\"159.033203\" xlink:href=\"#DejaVuSans-48\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"ytick_9\">\n     <g id=\"line2d_11\">\n      <g>\n       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"156.892625\" xlink:href=\"#m43e3cfbb5f\" y=\"42.615\"/>\n      </g>\n     </g>\n     <g id=\"text_13\">\n      <!-- 0.75 -->\n      <defs>\n       <path d=\"M 8.203125 72.90625 \nL 55.078125 72.90625 \nL 55.078125 68.703125 \nL 28.609375 0 \nL 18.3125 0 \nL 43.21875 64.59375 \nL 8.203125 64.59375 \nz\n\" id=\"DejaVuSans-55\"/>\n      </defs>\n      <g transform=\"translate(163.892625 46.414219)scale(0.1 -0.1)\">\n       <use xlink:href=\"#DejaVuSans-48\"/>\n       <use x=\"63.623047\" xlink:href=\"#DejaVuSans-46\"/>\n       <use x=\"95.410156\" xlink:href=\"#DejaVuSans-55\"/>\n       <use x=\"159.033203\" xlink:href=\"#DejaVuSans-53\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"ytick_10\">\n     <g id=\"line2d_12\">\n      <g>\n       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"156.892625\" xlink:href=\"#m43e3cfbb5f\" y=\"22.23\"/>\n      </g>\n     </g>\n     <g id=\"text_14\">\n      <!-- 1.00 -->\n      <defs>\n       <path d=\"M 12.40625 8.296875 \nL 28.515625 8.296875 \nL 28.515625 63.921875 \nL 10.984375 60.40625 \nL 10.984375 69.390625 \nL 28.421875 72.90625 \nL 38.28125 72.90625 \nL 38.28125 8.296875 \nL 54.390625 8.296875 \nL 54.390625 0 \nL 12.40625 0 \nz\n\" id=\"DejaVuSans-49\"/>\n      </defs>\n      <g transform=\"translate(163.892625 26.029219)scale(0.1 -0.1)\">\n       <use xlink:href=\"#DejaVuSans-49\"/>\n       <use x=\"63.623047\" xlink:href=\"#DejaVuSans-46\"/>\n       <use x=\"95.410156\" xlink:href=\"#DejaVuSans-48\"/>\n       <use x=\"159.033203\" xlink:href=\"#DejaVuSans-48\"/>\n      </g>\n     </g>\n    </g>\n   </g>\n   <g id=\"patch_8\">\n    <path d=\"M 152.815625 103.77 \nL 152.815625 103.451484 \nL 152.815625 22.548516 \nL 152.815625 22.23 \nL 156.892625 22.23 \nL 156.892625 22.548516 \nL 156.892625 103.451484 \nL 156.892625 103.77 \nz\n\" style=\"fill:none;stroke:#000000;stroke-linejoin:miter;stroke-width:0.8;\"/>\n   </g>\n  </g>\n </g>\n <defs>\n  <clipPath id=\"p5fd74f4cc7\">\n   <rect height=\"111.6\" width=\"111.6\" x=\"34.240625\" y=\"7.2\"/>\n  </clipPath>\n  <clipPath id=\"p39af209151\">\n   <rect height=\"81.54\" width=\"4.077\" x=\"152.815625\" y=\"22.23\"/>\n  </clipPath>\n </defs>\n</svg>\n",
            "text/plain": [
              "<Figure size 180x180 with 2 Axes>"
            ]
          },
          "metadata": {
            "needs_background": "light"
          },
          "output_type": "display_data"
        }
      ],
      "source": [
        "attention_weights = torch.eye(10).reshape((1, 1, 10, 10))\n",
        "show_heatmaps(attention_weights, xlabel='Keys', ylabel='Queries')"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "XtPmjBOus5Fp"
      },
      "source": [
        "##注意力汇聚：Nadaraya-Watson核回归"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "id": "aGc2DVS6wJtI"
      },
      "outputs": [],
      "source": [
        "import torch\n",
        "from torch import nn\n",
        "from d2l import torch as d2l"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "BYx95qIS5dLs"
      },
      "source": [
        "###生成数据集\n",
        "\n",
        "根据非线性函数：\\begin{equation} y_i = 2sin(x_i) + x_{i}^{0.8} + \\xi \\end{equation}\n",
        "生成数据集"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "id": "01_GUkxdz0Tg"
      },
      "outputs": [],
      "source": [
        "n_train = 50 # 训练样本数\n",
        "x_train, _ = torch.sort(torch.rand(n_train)*5) # 排序后的训练样本"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/"
        },
        "id": "ObpH0AgS0SnX",
        "outputId": "76f11d43-a9c5-403b-825f-5fd4fed24ebe"
      },
      "outputs": [
        {
          "data": {
            "text/plain": [
              "50"
            ]
          },
          "execution_count": 22,
          "metadata": {},
          "output_type": "execute_result"
        }
      ],
      "source": [
        "def f(x):\n",
        "    return 2 * torch.sin(x) + x**0.8\n",
        "\n",
        "y_train = f(x_train) + torch.normal(0.0,0.5,(n_train,)) # 训练样本的输出\n",
        "x_test = torch.arange(0,5,0.1) # 测试样本\n",
        "y_truth = f(x_test) # 测试样本的真实输出\n",
        "n_test = len(x_test) # 测试样本数\n",
        "n_test"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "PATRJgPR7nhh"
      },
      "source": [
        "\n",
        "\n",
        "*   训练样本（由圆圈表示）\n",
        "*   不带噪声项的真实数据生成的函数f（标记为\"Truth\"）\n",
        "*   学习得到的预测函数（标记为\"Pred\"）\n",
        "\n",
        "\n"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "id": "dadBcSmY1Clh"
      },
      "outputs": [],
      "source": [
        "def plot_kernel_reg(y_hat):\n",
        "    d2l.plot(x_test,[y_truth,y_hat],'x','y',legend=['Truth','Pred'],xlim=[0,5],ylim=[-1,5])\n",
        "    d2l.plt.plot(x_train,y_train,'o',alpha=0.5)"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "eui1-By52VL_"
      },
      "source": [
        "###平均汇聚\n",
        "平均汇聚的公式\\begin{equation} f(x) = \\frac{1}{n}Σ_{i=1}^{n}y_i\\end{equation}"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 267
        },
        "id": "eM5YxumL1ujt",
        "outputId": "221d8c51-4608-4061-ecd4-6ceaee780027"
      },
      "outputs": [
        {
          "data": {
            "image/svg+xml": "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"no\"?>\n<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\"\n  \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">\n<!-- Created with matplotlib (https://matplotlib.org/) -->\n<svg height=\"184.455469pt\" version=\"1.1\" viewBox=\"0 0 248.301563 184.455469\" width=\"248.301563pt\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n <defs>\n  <style type=\"text/css\">\n*{stroke-linecap:butt;stroke-linejoin:round;}\n  </style>\n </defs>\n <g id=\"figure_1\">\n  <g id=\"patch_1\">\n   <path d=\"M 0 184.455469 \nL 248.301563 184.455469 \nL 248.301563 -0 \nL 0 -0 \nz\n\" style=\"fill:none;\"/>\n  </g>\n  <g id=\"axes_1\">\n   <g id=\"patch_2\">\n    <path d=\"M 42.620312 146.899219 \nL 237.920313 146.899219 \nL 237.920313 10.999219 \nL 42.620312 10.999219 \nz\n\" style=\"fill:#ffffff;\"/>\n   </g>\n   <g id=\"matplotlib.axis_1\">\n    <g id=\"xtick_1\">\n     <g id=\"line2d_1\">\n      <path clip-path=\"url(#p168990143c)\" d=\"M 42.620312 146.899219 \nL 42.620312 10.999219 \n\" style=\"fill:none;stroke:#b0b0b0;stroke-linecap:square;stroke-width:0.8;\"/>\n     </g>\n     <g id=\"line2d_2\">\n      <defs>\n       <path d=\"M 0 0 \nL 0 3.5 \n\" id=\"m586272ef0f\" style=\"stroke:#000000;stroke-width:0.8;\"/>\n      </defs>\n      <g>\n       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"42.620312\" xlink:href=\"#m586272ef0f\" y=\"146.899219\"/>\n      </g>\n     </g>\n     <g id=\"text_1\">\n      <!-- 0 -->\n      <defs>\n       <path d=\"M 31.78125 66.40625 \nQ 24.171875 66.40625 20.328125 58.90625 \nQ 16.5 51.421875 16.5 36.375 \nQ 16.5 21.390625 20.328125 13.890625 \nQ 24.171875 6.390625 31.78125 6.390625 \nQ 39.453125 6.390625 43.28125 13.890625 \nQ 47.125 21.390625 47.125 36.375 \nQ 47.125 51.421875 43.28125 58.90625 \nQ 39.453125 66.40625 31.78125 66.40625 \nz\nM 31.78125 74.21875 \nQ 44.046875 74.21875 50.515625 64.515625 \nQ 56.984375 54.828125 56.984375 36.375 \nQ 56.984375 17.96875 50.515625 8.265625 \nQ 44.046875 -1.421875 31.78125 -1.421875 \nQ 19.53125 -1.421875 13.0625 8.265625 \nQ 6.59375 17.96875 6.59375 36.375 \nQ 6.59375 54.828125 13.0625 64.515625 \nQ 19.53125 74.21875 31.78125 74.21875 \nz\n\" id=\"DejaVuSans-48\"/>\n      </defs>\n      <g transform=\"translate(39.439062 161.497656)scale(0.1 -0.1)\">\n       <use xlink:href=\"#DejaVuSans-48\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"xtick_2\">\n     <g id=\"line2d_3\">\n      <path clip-path=\"url(#p168990143c)\" d=\"M 81.680312 146.899219 \nL 81.680312 10.999219 \n\" style=\"fill:none;stroke:#b0b0b0;stroke-linecap:square;stroke-width:0.8;\"/>\n     </g>\n     <g id=\"line2d_4\">\n      <g>\n       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"81.680312\" xlink:href=\"#m586272ef0f\" y=\"146.899219\"/>\n      </g>\n     </g>\n     <g id=\"text_2\">\n      <!-- 1 -->\n      <defs>\n       <path d=\"M 12.40625 8.296875 \nL 28.515625 8.296875 \nL 28.515625 63.921875 \nL 10.984375 60.40625 \nL 10.984375 69.390625 \nL 28.421875 72.90625 \nL 38.28125 72.90625 \nL 38.28125 8.296875 \nL 54.390625 8.296875 \nL 54.390625 0 \nL 12.40625 0 \nz\n\" id=\"DejaVuSans-49\"/>\n      </defs>\n      <g transform=\"translate(78.499062 161.497656)scale(0.1 -0.1)\">\n       <use xlink:href=\"#DejaVuSans-49\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"xtick_3\">\n     <g id=\"line2d_5\">\n      <path clip-path=\"url(#p168990143c)\" d=\"M 120.740313 146.899219 \nL 120.740313 10.999219 \n\" style=\"fill:none;stroke:#b0b0b0;stroke-linecap:square;stroke-width:0.8;\"/>\n     </g>\n     <g id=\"line2d_6\">\n      <g>\n       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"120.740313\" xlink:href=\"#m586272ef0f\" y=\"146.899219\"/>\n      </g>\n     </g>\n     <g id=\"text_3\">\n      <!-- 2 -->\n      <defs>\n       <path d=\"M 19.1875 8.296875 \nL 53.609375 8.296875 \nL 53.609375 0 \nL 7.328125 0 \nL 7.328125 8.296875 \nQ 12.9375 14.109375 22.625 23.890625 \nQ 32.328125 33.6875 34.8125 36.53125 \nQ 39.546875 41.84375 41.421875 45.53125 \nQ 43.3125 49.21875 43.3125 52.78125 \nQ 43.3125 58.59375 39.234375 62.25 \nQ 35.15625 65.921875 28.609375 65.921875 \nQ 23.96875 65.921875 18.8125 64.3125 \nQ 13.671875 62.703125 7.8125 59.421875 \nL 7.8125 69.390625 \nQ 13.765625 71.78125 18.9375 73 \nQ 24.125 74.21875 28.421875 74.21875 \nQ 39.75 74.21875 46.484375 68.546875 \nQ 53.21875 62.890625 53.21875 53.421875 \nQ 53.21875 48.921875 51.53125 44.890625 \nQ 49.859375 40.875 45.40625 35.40625 \nQ 44.1875 33.984375 37.640625 27.21875 \nQ 31.109375 20.453125 19.1875 8.296875 \nz\n\" id=\"DejaVuSans-50\"/>\n      </defs>\n      <g transform=\"translate(117.559062 161.497656)scale(0.1 -0.1)\">\n       <use xlink:href=\"#DejaVuSans-50\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"xtick_4\">\n     <g id=\"line2d_7\">\n      <path clip-path=\"url(#p168990143c)\" d=\"M 159.800313 146.899219 \nL 159.800313 10.999219 \n\" style=\"fill:none;stroke:#b0b0b0;stroke-linecap:square;stroke-width:0.8;\"/>\n     </g>\n     <g id=\"line2d_8\">\n      <g>\n       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"159.800313\" xlink:href=\"#m586272ef0f\" y=\"146.899219\"/>\n      </g>\n     </g>\n     <g id=\"text_4\">\n      <!-- 3 -->\n      <defs>\n       <path d=\"M 40.578125 39.3125 \nQ 47.65625 37.796875 51.625 33 \nQ 55.609375 28.21875 55.609375 21.1875 \nQ 55.609375 10.40625 48.1875 4.484375 \nQ 40.765625 -1.421875 27.09375 -1.421875 \nQ 22.515625 -1.421875 17.65625 -0.515625 \nQ 12.796875 0.390625 7.625 2.203125 \nL 7.625 11.71875 \nQ 11.71875 9.328125 16.59375 8.109375 \nQ 21.484375 6.890625 26.8125 6.890625 \nQ 36.078125 6.890625 40.9375 10.546875 \nQ 45.796875 14.203125 45.796875 21.1875 \nQ 45.796875 27.640625 41.28125 31.265625 \nQ 36.765625 34.90625 28.71875 34.90625 \nL 20.21875 34.90625 \nL 20.21875 43.015625 \nL 29.109375 43.015625 \nQ 36.375 43.015625 40.234375 45.921875 \nQ 44.09375 48.828125 44.09375 54.296875 \nQ 44.09375 59.90625 40.109375 62.90625 \nQ 36.140625 65.921875 28.71875 65.921875 \nQ 24.65625 65.921875 20.015625 65.03125 \nQ 15.375 64.15625 9.8125 62.3125 \nL 9.8125 71.09375 \nQ 15.4375 72.65625 20.34375 73.4375 \nQ 25.25 74.21875 29.59375 74.21875 \nQ 40.828125 74.21875 47.359375 69.109375 \nQ 53.90625 64.015625 53.90625 55.328125 \nQ 53.90625 49.265625 50.4375 45.09375 \nQ 46.96875 40.921875 40.578125 39.3125 \nz\n\" id=\"DejaVuSans-51\"/>\n      </defs>\n      <g transform=\"translate(156.619063 161.497656)scale(0.1 -0.1)\">\n       <use xlink:href=\"#DejaVuSans-51\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"xtick_5\">\n     <g id=\"line2d_9\">\n      <path clip-path=\"url(#p168990143c)\" d=\"M 198.860313 146.899219 \nL 198.860313 10.999219 \n\" style=\"fill:none;stroke:#b0b0b0;stroke-linecap:square;stroke-width:0.8;\"/>\n     </g>\n     <g id=\"line2d_10\">\n      <g>\n       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"198.860313\" xlink:href=\"#m586272ef0f\" y=\"146.899219\"/>\n      </g>\n     </g>\n     <g id=\"text_5\">\n      <!-- 4 -->\n      <defs>\n       <path d=\"M 37.796875 64.3125 \nL 12.890625 25.390625 \nL 37.796875 25.390625 \nz\nM 35.203125 72.90625 \nL 47.609375 72.90625 \nL 47.609375 25.390625 \nL 58.015625 25.390625 \nL 58.015625 17.1875 \nL 47.609375 17.1875 \nL 47.609375 0 \nL 37.796875 0 \nL 37.796875 17.1875 \nL 4.890625 17.1875 \nL 4.890625 26.703125 \nz\n\" id=\"DejaVuSans-52\"/>\n      </defs>\n      <g transform=\"translate(195.679063 161.497656)scale(0.1 -0.1)\">\n       <use xlink:href=\"#DejaVuSans-52\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"xtick_6\">\n     <g id=\"line2d_11\">\n      <path clip-path=\"url(#p168990143c)\" d=\"M 237.920313 146.899219 \nL 237.920313 10.999219 \n\" style=\"fill:none;stroke:#b0b0b0;stroke-linecap:square;stroke-width:0.8;\"/>\n     </g>\n     <g id=\"line2d_12\">\n      <g>\n       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"237.920313\" xlink:href=\"#m586272ef0f\" y=\"146.899219\"/>\n      </g>\n     </g>\n     <g id=\"text_6\">\n      <!-- 5 -->\n      <defs>\n       <path d=\"M 10.796875 72.90625 \nL 49.515625 72.90625 \nL 49.515625 64.59375 \nL 19.828125 64.59375 \nL 19.828125 46.734375 \nQ 21.96875 47.46875 24.109375 47.828125 \nQ 26.265625 48.1875 28.421875 48.1875 \nQ 40.625 48.1875 47.75 41.5 \nQ 54.890625 34.8125 54.890625 23.390625 \nQ 54.890625 11.625 47.5625 5.09375 \nQ 40.234375 -1.421875 26.90625 -1.421875 \nQ 22.3125 -1.421875 17.546875 -0.640625 \nQ 12.796875 0.140625 7.71875 1.703125 \nL 7.71875 11.625 \nQ 12.109375 9.234375 16.796875 8.0625 \nQ 21.484375 6.890625 26.703125 6.890625 \nQ 35.15625 6.890625 40.078125 11.328125 \nQ 45.015625 15.765625 45.015625 23.390625 \nQ 45.015625 31 40.078125 35.4375 \nQ 35.15625 39.890625 26.703125 39.890625 \nQ 22.75 39.890625 18.8125 39.015625 \nQ 14.890625 38.140625 10.796875 36.28125 \nz\n\" id=\"DejaVuSans-53\"/>\n      </defs>\n      <g transform=\"translate(234.739063 161.497656)scale(0.1 -0.1)\">\n       <use xlink:href=\"#DejaVuSans-53\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"text_7\">\n     <!-- x -->\n     <defs>\n      <path d=\"M 54.890625 54.6875 \nL 35.109375 28.078125 \nL 55.90625 0 \nL 45.3125 0 \nL 29.390625 21.484375 \nL 13.484375 0 \nL 2.875 0 \nL 24.125 28.609375 \nL 4.6875 54.6875 \nL 15.28125 54.6875 \nL 29.78125 35.203125 \nL 44.28125 54.6875 \nz\n\" id=\"DejaVuSans-120\"/>\n     </defs>\n     <g transform=\"translate(137.310937 175.175781)scale(0.1 -0.1)\">\n      <use xlink:href=\"#DejaVuSans-120\"/>\n     </g>\n    </g>\n   </g>\n   <g id=\"matplotlib.axis_2\">\n    <g id=\"ytick_1\">\n     <g id=\"line2d_13\">\n      <path clip-path=\"url(#p168990143c)\" d=\"M 42.620312 146.899219 \nL 237.920313 146.899219 \n\" style=\"fill:none;stroke:#b0b0b0;stroke-linecap:square;stroke-width:0.8;\"/>\n     </g>\n     <g id=\"line2d_14\">\n      <defs>\n       <path d=\"M 0 0 \nL -3.5 0 \n\" id=\"mc35a8f22a8\" style=\"stroke:#000000;stroke-width:0.8;\"/>\n      </defs>\n      <g>\n       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"42.620312\" xlink:href=\"#mc35a8f22a8\" y=\"146.899219\"/>\n      </g>\n     </g>\n     <g id=\"text_8\">\n      <!-- −1 -->\n      <defs>\n       <path d=\"M 10.59375 35.5 \nL 73.1875 35.5 \nL 73.1875 27.203125 \nL 10.59375 27.203125 \nz\n\" id=\"DejaVuSans-8722\"/>\n      </defs>\n      <g transform=\"translate(20.878125 150.698437)scale(0.1 -0.1)\">\n       <use xlink:href=\"#DejaVuSans-8722\"/>\n       <use x=\"83.789062\" xlink:href=\"#DejaVuSans-49\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"ytick_2\">\n     <g id=\"line2d_15\">\n      <path clip-path=\"url(#p168990143c)\" d=\"M 42.620312 124.249219 \nL 237.920313 124.249219 \n\" style=\"fill:none;stroke:#b0b0b0;stroke-linecap:square;stroke-width:0.8;\"/>\n     </g>\n     <g id=\"line2d_16\">\n      <g>\n       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"42.620312\" xlink:href=\"#mc35a8f22a8\" y=\"124.249219\"/>\n      </g>\n     </g>\n     <g id=\"text_9\">\n      <!-- 0 -->\n      <g transform=\"translate(29.257812 128.048437)scale(0.1 -0.1)\">\n       <use xlink:href=\"#DejaVuSans-48\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"ytick_3\">\n     <g id=\"line2d_17\">\n      <path clip-path=\"url(#p168990143c)\" d=\"M 42.620312 101.599219 \nL 237.920313 101.599219 \n\" style=\"fill:none;stroke:#b0b0b0;stroke-linecap:square;stroke-width:0.8;\"/>\n     </g>\n     <g id=\"line2d_18\">\n      <g>\n       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"42.620312\" xlink:href=\"#mc35a8f22a8\" y=\"101.599219\"/>\n      </g>\n     </g>\n     <g id=\"text_10\">\n      <!-- 1 -->\n      <g transform=\"translate(29.257812 105.398437)scale(0.1 -0.1)\">\n       <use xlink:href=\"#DejaVuSans-49\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"ytick_4\">\n     <g id=\"line2d_19\">\n      <path clip-path=\"url(#p168990143c)\" d=\"M 42.620312 78.949219 \nL 237.920313 78.949219 \n\" style=\"fill:none;stroke:#b0b0b0;stroke-linecap:square;stroke-width:0.8;\"/>\n     </g>\n     <g id=\"line2d_20\">\n      <g>\n       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"42.620312\" xlink:href=\"#mc35a8f22a8\" y=\"78.949219\"/>\n      </g>\n     </g>\n     <g id=\"text_11\">\n      <!-- 2 -->\n      <g transform=\"translate(29.257812 82.748437)scale(0.1 -0.1)\">\n       <use xlink:href=\"#DejaVuSans-50\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"ytick_5\">\n     <g id=\"line2d_21\">\n      <path clip-path=\"url(#p168990143c)\" d=\"M 42.620312 56.299219 \nL 237.920313 56.299219 \n\" style=\"fill:none;stroke:#b0b0b0;stroke-linecap:square;stroke-width:0.8;\"/>\n     </g>\n     <g id=\"line2d_22\">\n      <g>\n       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"42.620312\" xlink:href=\"#mc35a8f22a8\" y=\"56.299219\"/>\n      </g>\n     </g>\n     <g id=\"text_12\">\n      <!-- 3 -->\n      <g transform=\"translate(29.257812 60.098437)scale(0.1 -0.1)\">\n       <use xlink:href=\"#DejaVuSans-51\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"ytick_6\">\n     <g id=\"line2d_23\">\n      <path clip-path=\"url(#p168990143c)\" d=\"M 42.620312 33.649219 \nL 237.920313 33.649219 \n\" style=\"fill:none;stroke:#b0b0b0;stroke-linecap:square;stroke-width:0.8;\"/>\n     </g>\n     <g id=\"line2d_24\">\n      <g>\n       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"42.620312\" xlink:href=\"#mc35a8f22a8\" y=\"33.649219\"/>\n      </g>\n     </g>\n     <g id=\"text_13\">\n      <!-- 4 -->\n      <g transform=\"translate(29.257812 37.448437)scale(0.1 -0.1)\">\n       <use xlink:href=\"#DejaVuSans-52\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"ytick_7\">\n     <g id=\"line2d_25\">\n      <path clip-path=\"url(#p168990143c)\" d=\"M 42.620312 10.999219 \nL 237.920313 10.999219 \n\" style=\"fill:none;stroke:#b0b0b0;stroke-linecap:square;stroke-width:0.8;\"/>\n     </g>\n     <g id=\"line2d_26\">\n      <g>\n       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"42.620312\" xlink:href=\"#mc35a8f22a8\" y=\"10.999219\"/>\n      </g>\n     </g>\n     <g id=\"text_14\">\n      <!-- 5 -->\n      <g transform=\"translate(29.257812 14.798437)scale(0.1 -0.1)\">\n       <use xlink:href=\"#DejaVuSans-53\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"text_15\">\n     <!-- y -->\n     <defs>\n      <path d=\"M 32.171875 -5.078125 \nQ 28.375 -14.84375 24.75 -17.8125 \nQ 21.140625 -20.796875 15.09375 -20.796875 \nL 7.90625 -20.796875 \nL 7.90625 -13.28125 \nL 13.1875 -13.28125 \nQ 16.890625 -13.28125 18.9375 -11.515625 \nQ 21 -9.765625 23.484375 -3.21875 \nL 25.09375 0.875 \nL 2.984375 54.6875 \nL 12.5 54.6875 \nL 29.59375 11.921875 \nL 46.6875 54.6875 \nL 56.203125 54.6875 \nz\n\" id=\"DejaVuSans-121\"/>\n     </defs>\n     <g transform=\"translate(14.798437 81.908594)rotate(-90)scale(0.1 -0.1)\">\n      <use xlink:href=\"#DejaVuSans-121\"/>\n     </g>\n    </g>\n   </g>\n   <g id=\"line2d_27\">\n    <path clip-path=\"url(#p168990143c)\" d=\"M 42.620312 124.249219 \nL 46.526313 116.136982 \nL 50.432313 108.999323 \nL 54.338313 102.217148 \nL 58.244313 95.726379 \nL 62.150312 89.522233 \nL 66.056313 83.619087 \nL 69.962312 78.038824 \nL 73.868313 72.806 \nL 77.774314 67.945395 \nL 81.680312 63.480584 \nL 85.586313 59.432954 \nL 89.492314 55.821098 \nL 93.398311 52.660258 \nL 97.304312 49.962036 \nL 101.210313 47.734078 \nL 105.116313 45.979911 \nL 109.022314 44.69881 \nL 112.928315 43.885737 \nL 116.834312 43.531371 \nL 120.740313 43.622105 \nL 124.646309 44.140188 \nL 128.552314 45.063873 \nL 132.458311 46.367563 \nL 136.364316 48.022135 \nL 140.270312 49.995107 \nL 144.176318 52.251038 \nL 148.082314 54.751808 \nL 151.98832 57.457039 \nL 155.894316 60.324422 \nL 159.800313 63.310193 \nL 163.706318 66.369546 \nL 167.612314 69.45704 \nL 171.518311 72.527086 \nL 175.424316 75.534393 \nL 179.330312 78.434371 \nL 183.236318 81.183652 \nL 187.142314 83.740416 \nL 191.048311 86.06491 \nL 194.954316 88.119776 \nL 198.860313 89.870412 \nL 202.766309 91.285368 \nL 206.672305 92.336626 \nL 210.57832 92.999866 \nL 214.484316 93.254719 \nL 218.390312 93.084986 \nL 222.296309 92.478756 \nL 226.202305 91.428572 \nL 230.10832 89.931453 \nL 234.014316 87.988973 \n\" style=\"fill:none;stroke:#1f77b4;stroke-linecap:square;stroke-width:1.5;\"/>\n   </g>\n   <g id=\"line2d_28\">\n    <path clip-path=\"url(#p168990143c)\" d=\"M 42.620312 65.173174 \nL 46.526313 65.173174 \nL 50.432313 65.173174 \nL 54.338313 65.173174 \nL 58.244313 65.173174 \nL 62.150312 65.173174 \nL 66.056313 65.173174 \nL 69.962312 65.173174 \nL 73.868313 65.173174 \nL 77.774314 65.173174 \nL 81.680312 65.173174 \nL 85.586313 65.173174 \nL 89.492314 65.173174 \nL 93.398311 65.173174 \nL 97.304312 65.173174 \nL 101.210313 65.173174 \nL 105.116313 65.173174 \nL 109.022314 65.173174 \nL 112.928315 65.173174 \nL 116.834312 65.173174 \nL 120.740313 65.173174 \nL 124.646309 65.173174 \nL 128.552314 65.173174 \nL 132.458311 65.173174 \nL 136.364316 65.173174 \nL 140.270312 65.173174 \nL 144.176318 65.173174 \nL 148.082314 65.173174 \nL 151.98832 65.173174 \nL 155.894316 65.173174 \nL 159.800313 65.173174 \nL 163.706318 65.173174 \nL 167.612314 65.173174 \nL 171.518311 65.173174 \nL 175.424316 65.173174 \nL 179.330312 65.173174 \nL 183.236318 65.173174 \nL 187.142314 65.173174 \nL 191.048311 65.173174 \nL 194.954316 65.173174 \nL 198.860313 65.173174 \nL 202.766309 65.173174 \nL 206.672305 65.173174 \nL 210.57832 65.173174 \nL 214.484316 65.173174 \nL 218.390312 65.173174 \nL 222.296309 65.173174 \nL 226.202305 65.173174 \nL 230.10832 65.173174 \nL 234.014316 65.173174 \n\" style=\"fill:none;stroke:#bf00bf;stroke-dasharray:5.55,2.4;stroke-dashoffset:0;stroke-width:1.5;\"/>\n   </g>\n   <g id=\"line2d_29\">\n    <defs>\n     <path d=\"M 0 3 \nC 0.795609 3 1.55874 2.683901 2.12132 2.12132 \nC 2.683901 1.55874 3 0.795609 3 0 \nC 3 -0.795609 2.683901 -1.55874 2.12132 -2.12132 \nC 1.55874 -2.683901 0.795609 -3 0 -3 \nC -0.795609 -3 -1.55874 -2.683901 -2.12132 -2.12132 \nC -2.683901 -1.55874 -3 -0.795609 -3 0 \nC -3 0.795609 -2.683901 1.55874 -2.12132 2.12132 \nC -1.55874 2.683901 -0.795609 3 0 3 \nz\n\" id=\"me6c119650e\" style=\"stroke:#ff7f0e;stroke-opacity:0.5;\"/>\n    </defs>\n    <g clip-path=\"url(#p168990143c)\">\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"57.227417\" xlink:href=\"#me6c119650e\" y=\"86.054806\"/>\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"58.094818\" xlink:href=\"#me6c119650e\" y=\"94.550419\"/>\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"58.378528\" xlink:href=\"#me6c119650e\" y=\"99.183761\"/>\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"61.559268\" xlink:href=\"#me6c119650e\" y=\"80.290842\"/>\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"61.669995\" xlink:href=\"#me6c119650e\" y=\"94.281191\"/>\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"62.106967\" xlink:href=\"#me6c119650e\" y=\"78.474019\"/>\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"63.50293\" xlink:href=\"#me6c119650e\" y=\"77.736592\"/>\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"66.629448\" xlink:href=\"#me6c119650e\" y=\"93.017694\"/>\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"67.547324\" xlink:href=\"#me6c119650e\" y=\"81.544259\"/>\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"74.548966\" xlink:href=\"#me6c119650e\" y=\"78.756935\"/>\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"79.19761\" xlink:href=\"#me6c119650e\" y=\"65.54637\"/>\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"82.758203\" xlink:href=\"#me6c119650e\" y=\"65.287226\"/>\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"87.728959\" xlink:href=\"#me6c119650e\" y=\"39.192585\"/>\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"96.636908\" xlink:href=\"#me6c119650e\" y=\"61.057534\"/>\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"100.850812\" xlink:href=\"#me6c119650e\" y=\"41.745807\"/>\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"103.226883\" xlink:href=\"#me6c119650e\" y=\"45.203176\"/>\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"105.008296\" xlink:href=\"#me6c119650e\" y=\"17.397591\"/>\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"105.19826\" xlink:href=\"#me6c119650e\" y=\"37.219494\"/>\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"105.274046\" xlink:href=\"#me6c119650e\" y=\"52.471025\"/>\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"107.624377\" xlink:href=\"#me6c119650e\" y=\"44.95717\"/>\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"110.088583\" xlink:href=\"#me6c119650e\" y=\"49.486896\"/>\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"112.502044\" xlink:href=\"#me6c119650e\" y=\"51.095799\"/>\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"115.543651\" xlink:href=\"#me6c119650e\" y=\"39.379707\"/>\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"116.068595\" xlink:href=\"#me6c119650e\" y=\"36.774131\"/>\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"120.220463\" xlink:href=\"#me6c119650e\" y=\"37.887896\"/>\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"124.697323\" xlink:href=\"#me6c119650e\" y=\"54.664325\"/>\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"126.683642\" xlink:href=\"#me6c119650e\" y=\"44.087228\"/>\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"128.566777\" xlink:href=\"#me6c119650e\" y=\"47.897666\"/>\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"132.243394\" xlink:href=\"#me6c119650e\" y=\"51.144141\"/>\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"134.251951\" xlink:href=\"#me6c119650e\" y=\"39.51685\"/>\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"134.784475\" xlink:href=\"#me6c119650e\" y=\"47.0668\"/>\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"138.165174\" xlink:href=\"#me6c119650e\" y=\"31.170827\"/>\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"149.407781\" xlink:href=\"#me6c119650e\" y=\"54.17124\"/>\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"165.238981\" xlink:href=\"#me6c119650e\" y=\"73.108734\"/>\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"166.60222\" xlink:href=\"#me6c119650e\" y=\"81.738185\"/>\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"168.585251\" xlink:href=\"#me6c119650e\" y=\"62.365814\"/>\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"169.344305\" xlink:href=\"#me6c119650e\" y=\"56.057247\"/>\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"175.803154\" xlink:href=\"#me6c119650e\" y=\"72.893974\"/>\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"177.333918\" xlink:href=\"#me6c119650e\" y=\"57.874025\"/>\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"182.188414\" xlink:href=\"#me6c119650e\" y=\"84.215918\"/>\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"186.843761\" xlink:href=\"#me6c119650e\" y=\"91.090521\"/>\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"189.515601\" xlink:href=\"#me6c119650e\" y=\"111.352993\"/>\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"190.372204\" xlink:href=\"#me6c119650e\" y=\"79.613862\"/>\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"192.53008\" xlink:href=\"#me6c119650e\" y=\"69.098679\"/>\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"203.411004\" xlink:href=\"#me6c119650e\" y=\"101.960855\"/>\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"209.29381\" xlink:href=\"#me6c119650e\" y=\"82.990244\"/>\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"229.549041\" xlink:href=\"#me6c119650e\" y=\"78.088074\"/>\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"229.834119\" xlink:href=\"#me6c119650e\" y=\"75.026041\"/>\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"232.208914\" xlink:href=\"#me6c119650e\" y=\"76.215161\"/>\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"232.414574\" xlink:href=\"#me6c119650e\" y=\"86.656578\"/>\n    </g>\n   </g>\n   <g id=\"patch_3\">\n    <path d=\"M 42.620312 146.899219 \nL 42.620312 10.999219 \n\" style=\"fill:none;stroke:#000000;stroke-linecap:square;stroke-linejoin:miter;stroke-width:0.8;\"/>\n   </g>\n   <g id=\"patch_4\">\n    <path d=\"M 237.920313 146.899219 \nL 237.920313 10.999219 \n\" style=\"fill:none;stroke:#000000;stroke-linecap:square;stroke-linejoin:miter;stroke-width:0.8;\"/>\n   </g>\n   <g id=\"patch_5\">\n    <path d=\"M 42.620312 146.899219 \nL 237.920313 146.899219 \n\" style=\"fill:none;stroke:#000000;stroke-linecap:square;stroke-linejoin:miter;stroke-width:0.8;\"/>\n   </g>\n   <g id=\"patch_6\">\n    <path d=\"M 42.620312 10.999219 \nL 237.920313 10.999219 \n\" style=\"fill:none;stroke:#000000;stroke-linecap:square;stroke-linejoin:miter;stroke-width:0.8;\"/>\n   </g>\n   <g id=\"legend_1\">\n    <g id=\"patch_7\">\n     <path d=\"M 173.58125 48.355469 \nL 230.920313 48.355469 \nQ 232.920313 48.355469 232.920313 46.355469 \nL 232.920313 17.999219 \nQ 232.920313 15.999219 230.920313 15.999219 \nL 173.58125 15.999219 \nQ 171.58125 15.999219 171.58125 17.999219 \nL 171.58125 46.355469 \nQ 171.58125 48.355469 173.58125 48.355469 \nz\n\" style=\"fill:#ffffff;opacity:0.8;stroke:#cccccc;stroke-linejoin:miter;\"/>\n    </g>\n    <g id=\"line2d_30\">\n     <path d=\"M 175.58125 24.097656 \nL 195.58125 24.097656 \n\" style=\"fill:none;stroke:#1f77b4;stroke-linecap:square;stroke-width:1.5;\"/>\n    </g>\n    <g id=\"line2d_31\"/>\n    <g id=\"text_16\">\n     <!-- Truth -->\n     <defs>\n      <path d=\"M -0.296875 72.90625 \nL 61.375 72.90625 \nL 61.375 64.59375 \nL 35.5 64.59375 \nL 35.5 0 \nL 25.59375 0 \nL 25.59375 64.59375 \nL -0.296875 64.59375 \nz\n\" id=\"DejaVuSans-84\"/>\n      <path d=\"M 41.109375 46.296875 \nQ 39.59375 47.171875 37.8125 47.578125 \nQ 36.03125 48 33.890625 48 \nQ 26.265625 48 22.1875 43.046875 \nQ 18.109375 38.09375 18.109375 28.8125 \nL 18.109375 0 \nL 9.078125 0 \nL 9.078125 54.6875 \nL 18.109375 54.6875 \nL 18.109375 46.1875 \nQ 20.953125 51.171875 25.484375 53.578125 \nQ 30.03125 56 36.53125 56 \nQ 37.453125 56 38.578125 55.875 \nQ 39.703125 55.765625 41.0625 55.515625 \nz\n\" id=\"DejaVuSans-114\"/>\n      <path d=\"M 8.5 21.578125 \nL 8.5 54.6875 \nL 17.484375 54.6875 \nL 17.484375 21.921875 \nQ 17.484375 14.15625 20.5 10.265625 \nQ 23.53125 6.390625 29.59375 6.390625 \nQ 36.859375 6.390625 41.078125 11.03125 \nQ 45.3125 15.671875 45.3125 23.6875 \nL 45.3125 54.6875 \nL 54.296875 54.6875 \nL 54.296875 0 \nL 45.3125 0 \nL 45.3125 8.40625 \nQ 42.046875 3.421875 37.71875 1 \nQ 33.40625 -1.421875 27.6875 -1.421875 \nQ 18.265625 -1.421875 13.375 4.4375 \nQ 8.5 10.296875 8.5 21.578125 \nz\nM 31.109375 56 \nz\n\" id=\"DejaVuSans-117\"/>\n      <path d=\"M 18.3125 70.21875 \nL 18.3125 54.6875 \nL 36.8125 54.6875 \nL 36.8125 47.703125 \nL 18.3125 47.703125 \nL 18.3125 18.015625 \nQ 18.3125 11.328125 20.140625 9.421875 \nQ 21.96875 7.515625 27.59375 7.515625 \nL 36.8125 7.515625 \nL 36.8125 0 \nL 27.59375 0 \nQ 17.1875 0 13.234375 3.875 \nQ 9.28125 7.765625 9.28125 18.015625 \nL 9.28125 47.703125 \nL 2.6875 47.703125 \nL 2.6875 54.6875 \nL 9.28125 54.6875 \nL 9.28125 70.21875 \nz\n\" id=\"DejaVuSans-116\"/>\n      <path d=\"M 54.890625 33.015625 \nL 54.890625 0 \nL 45.90625 0 \nL 45.90625 32.71875 \nQ 45.90625 40.484375 42.875 44.328125 \nQ 39.84375 48.1875 33.796875 48.1875 \nQ 26.515625 48.1875 22.3125 43.546875 \nQ 18.109375 38.921875 18.109375 30.90625 \nL 18.109375 0 \nL 9.078125 0 \nL 9.078125 75.984375 \nL 18.109375 75.984375 \nL 18.109375 46.1875 \nQ 21.34375 51.125 25.703125 53.5625 \nQ 30.078125 56 35.796875 56 \nQ 45.21875 56 50.046875 50.171875 \nQ 54.890625 44.34375 54.890625 33.015625 \nz\n\" id=\"DejaVuSans-104\"/>\n     </defs>\n     <g transform=\"translate(203.58125 27.597656)scale(0.1 -0.1)\">\n      <use xlink:href=\"#DejaVuSans-84\"/>\n      <use x=\"46.333984\" xlink:href=\"#DejaVuSans-114\"/>\n      <use x=\"87.447266\" xlink:href=\"#DejaVuSans-117\"/>\n      <use x=\"150.826172\" xlink:href=\"#DejaVuSans-116\"/>\n      <use x=\"190.035156\" xlink:href=\"#DejaVuSans-104\"/>\n     </g>\n    </g>\n    <g id=\"line2d_32\">\n     <path d=\"M 175.58125 38.775781 \nL 195.58125 38.775781 \n\" style=\"fill:none;stroke:#bf00bf;stroke-dasharray:5.55,2.4;stroke-dashoffset:0;stroke-width:1.5;\"/>\n    </g>\n    <g id=\"line2d_33\"/>\n    <g id=\"text_17\">\n     <!-- Pred -->\n     <defs>\n      <path d=\"M 19.671875 64.796875 \nL 19.671875 37.40625 \nL 32.078125 37.40625 \nQ 38.96875 37.40625 42.71875 40.96875 \nQ 46.484375 44.53125 46.484375 51.125 \nQ 46.484375 57.671875 42.71875 61.234375 \nQ 38.96875 64.796875 32.078125 64.796875 \nz\nM 9.8125 72.90625 \nL 32.078125 72.90625 \nQ 44.34375 72.90625 50.609375 67.359375 \nQ 56.890625 61.8125 56.890625 51.125 \nQ 56.890625 40.328125 50.609375 34.8125 \nQ 44.34375 29.296875 32.078125 29.296875 \nL 19.671875 29.296875 \nL 19.671875 0 \nL 9.8125 0 \nz\n\" id=\"DejaVuSans-80\"/>\n      <path d=\"M 56.203125 29.59375 \nL 56.203125 25.203125 \nL 14.890625 25.203125 \nQ 15.484375 15.921875 20.484375 11.0625 \nQ 25.484375 6.203125 34.421875 6.203125 \nQ 39.59375 6.203125 44.453125 7.46875 \nQ 49.3125 8.734375 54.109375 11.28125 \nL 54.109375 2.78125 \nQ 49.265625 0.734375 44.1875 -0.34375 \nQ 39.109375 -1.421875 33.890625 -1.421875 \nQ 20.796875 -1.421875 13.15625 6.1875 \nQ 5.515625 13.8125 5.515625 26.8125 \nQ 5.515625 40.234375 12.765625 48.109375 \nQ 20.015625 56 32.328125 56 \nQ 43.359375 56 49.78125 48.890625 \nQ 56.203125 41.796875 56.203125 29.59375 \nz\nM 47.21875 32.234375 \nQ 47.125 39.59375 43.09375 43.984375 \nQ 39.0625 48.390625 32.421875 48.390625 \nQ 24.90625 48.390625 20.390625 44.140625 \nQ 15.875 39.890625 15.1875 32.171875 \nz\n\" id=\"DejaVuSans-101\"/>\n      <path d=\"M 45.40625 46.390625 \nL 45.40625 75.984375 \nL 54.390625 75.984375 \nL 54.390625 0 \nL 45.40625 0 \nL 45.40625 8.203125 \nQ 42.578125 3.328125 38.25 0.953125 \nQ 33.9375 -1.421875 27.875 -1.421875 \nQ 17.96875 -1.421875 11.734375 6.484375 \nQ 5.515625 14.40625 5.515625 27.296875 \nQ 5.515625 40.1875 11.734375 48.09375 \nQ 17.96875 56 27.875 56 \nQ 33.9375 56 38.25 53.625 \nQ 42.578125 51.265625 45.40625 46.390625 \nz\nM 14.796875 27.296875 \nQ 14.796875 17.390625 18.875 11.75 \nQ 22.953125 6.109375 30.078125 6.109375 \nQ 37.203125 6.109375 41.296875 11.75 \nQ 45.40625 17.390625 45.40625 27.296875 \nQ 45.40625 37.203125 41.296875 42.84375 \nQ 37.203125 48.484375 30.078125 48.484375 \nQ 22.953125 48.484375 18.875 42.84375 \nQ 14.796875 37.203125 14.796875 27.296875 \nz\n\" id=\"DejaVuSans-100\"/>\n     </defs>\n     <g transform=\"translate(203.58125 42.275781)scale(0.1 -0.1)\">\n      <use xlink:href=\"#DejaVuSans-80\"/>\n      <use x=\"58.552734\" xlink:href=\"#DejaVuSans-114\"/>\n      <use x=\"97.416016\" xlink:href=\"#DejaVuSans-101\"/>\n      <use x=\"158.939453\" xlink:href=\"#DejaVuSans-100\"/>\n     </g>\n    </g>\n   </g>\n  </g>\n </g>\n <defs>\n  <clipPath id=\"p168990143c\">\n   <rect height=\"135.9\" width=\"195.3\" x=\"42.620312\" y=\"10.999219\"/>\n  </clipPath>\n </defs>\n</svg>\n",
            "text/plain": [
              "<Figure size 252x180 with 1 Axes>"
            ]
          },
          "metadata": {
            "needs_background": "light"
          },
          "output_type": "display_data"
        }
      ],
      "source": [
        "y_hat = torch.repeat_interleave(y_train.mean(),n_test)\n",
        "plot_kernel_reg(y_hat)"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "wUlibgnD2a0k"
      },
      "source": [
        "###非参数注意力汇聚\n",
        "由于平均汇聚忽略了输入，因此根据输入的位置对输出进行加权：\n",
        "\\begin{equation} f(x)=Σ_{i=1}^{n}\\frac{K(x-x_i)}{Σ_{i=1}^{n}K(x-x_i)}y_i \\end{equation}\n",
        "经过改良，获得更通用的注意力汇聚公式：\n",
        "\\begin{equation} f(x)=Σ_{i=1}^{n}α(x,x_i)y_i \\end{equation}\n",
        "令高斯核为：\n",
        "\\begin{equation} K(u)=\\frac{1}{\\sqrt{2π}}exp(-\\frac{u^2}{2}) \\end{equation} \n",
        "将高斯核带入注意力汇聚公式：\n",
        "\\begin{equation} f(x)=Σ_{i=1}^{n}softmax(-\\frac{1}{2}(x-x_i)^2)y_i \\end{equation}\n",
        "如果一个键越是接近给定的查询，那么分配给这个键对应值的注意力权重就会越大，也就是“获得了更多的注意力”"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 267
        },
        "id": "9-e7Bhce17vq",
        "outputId": "a076cd95-acba-485b-84ff-98e383e7216d"
      },
      "outputs": [
        {
          "data": {
            "image/svg+xml": "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"no\"?>\n<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\"\n  \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">\n<!-- Created with matplotlib (https://matplotlib.org/) -->\n<svg height=\"184.455469pt\" version=\"1.1\" viewBox=\"0 0 248.301563 184.455469\" width=\"248.301563pt\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n <defs>\n  <style type=\"text/css\">\n*{stroke-linecap:butt;stroke-linejoin:round;}\n  </style>\n </defs>\n <g id=\"figure_1\">\n  <g id=\"patch_1\">\n   <path d=\"M 0 184.455469 \nL 248.301563 184.455469 \nL 248.301563 -0 \nL 0 -0 \nz\n\" style=\"fill:none;\"/>\n  </g>\n  <g id=\"axes_1\">\n   <g id=\"patch_2\">\n    <path d=\"M 42.620312 146.899219 \nL 237.920313 146.899219 \nL 237.920313 10.999219 \nL 42.620312 10.999219 \nz\n\" style=\"fill:#ffffff;\"/>\n   </g>\n   <g id=\"matplotlib.axis_1\">\n    <g id=\"xtick_1\">\n     <g id=\"line2d_1\">\n      <path clip-path=\"url(#p2947b66617)\" d=\"M 42.620312 146.899219 \nL 42.620312 10.999219 \n\" style=\"fill:none;stroke:#b0b0b0;stroke-linecap:square;stroke-width:0.8;\"/>\n     </g>\n     <g id=\"line2d_2\">\n      <defs>\n       <path d=\"M 0 0 \nL 0 3.5 \n\" id=\"mf9de5ce026\" style=\"stroke:#000000;stroke-width:0.8;\"/>\n      </defs>\n      <g>\n       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"42.620312\" xlink:href=\"#mf9de5ce026\" y=\"146.899219\"/>\n      </g>\n     </g>\n     <g id=\"text_1\">\n      <!-- 0 -->\n      <defs>\n       <path d=\"M 31.78125 66.40625 \nQ 24.171875 66.40625 20.328125 58.90625 \nQ 16.5 51.421875 16.5 36.375 \nQ 16.5 21.390625 20.328125 13.890625 \nQ 24.171875 6.390625 31.78125 6.390625 \nQ 39.453125 6.390625 43.28125 13.890625 \nQ 47.125 21.390625 47.125 36.375 \nQ 47.125 51.421875 43.28125 58.90625 \nQ 39.453125 66.40625 31.78125 66.40625 \nz\nM 31.78125 74.21875 \nQ 44.046875 74.21875 50.515625 64.515625 \nQ 56.984375 54.828125 56.984375 36.375 \nQ 56.984375 17.96875 50.515625 8.265625 \nQ 44.046875 -1.421875 31.78125 -1.421875 \nQ 19.53125 -1.421875 13.0625 8.265625 \nQ 6.59375 17.96875 6.59375 36.375 \nQ 6.59375 54.828125 13.0625 64.515625 \nQ 19.53125 74.21875 31.78125 74.21875 \nz\n\" id=\"DejaVuSans-48\"/>\n      </defs>\n      <g transform=\"translate(39.439062 161.497656)scale(0.1 -0.1)\">\n       <use xlink:href=\"#DejaVuSans-48\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"xtick_2\">\n     <g id=\"line2d_3\">\n      <path clip-path=\"url(#p2947b66617)\" d=\"M 81.680312 146.899219 \nL 81.680312 10.999219 \n\" style=\"fill:none;stroke:#b0b0b0;stroke-linecap:square;stroke-width:0.8;\"/>\n     </g>\n     <g id=\"line2d_4\">\n      <g>\n       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"81.680312\" xlink:href=\"#mf9de5ce026\" y=\"146.899219\"/>\n      </g>\n     </g>\n     <g id=\"text_2\">\n      <!-- 1 -->\n      <defs>\n       <path d=\"M 12.40625 8.296875 \nL 28.515625 8.296875 \nL 28.515625 63.921875 \nL 10.984375 60.40625 \nL 10.984375 69.390625 \nL 28.421875 72.90625 \nL 38.28125 72.90625 \nL 38.28125 8.296875 \nL 54.390625 8.296875 \nL 54.390625 0 \nL 12.40625 0 \nz\n\" id=\"DejaVuSans-49\"/>\n      </defs>\n      <g transform=\"translate(78.499062 161.497656)scale(0.1 -0.1)\">\n       <use xlink:href=\"#DejaVuSans-49\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"xtick_3\">\n     <g id=\"line2d_5\">\n      <path clip-path=\"url(#p2947b66617)\" d=\"M 120.740313 146.899219 \nL 120.740313 10.999219 \n\" style=\"fill:none;stroke:#b0b0b0;stroke-linecap:square;stroke-width:0.8;\"/>\n     </g>\n     <g id=\"line2d_6\">\n      <g>\n       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"120.740313\" xlink:href=\"#mf9de5ce026\" y=\"146.899219\"/>\n      </g>\n     </g>\n     <g id=\"text_3\">\n      <!-- 2 -->\n      <defs>\n       <path d=\"M 19.1875 8.296875 \nL 53.609375 8.296875 \nL 53.609375 0 \nL 7.328125 0 \nL 7.328125 8.296875 \nQ 12.9375 14.109375 22.625 23.890625 \nQ 32.328125 33.6875 34.8125 36.53125 \nQ 39.546875 41.84375 41.421875 45.53125 \nQ 43.3125 49.21875 43.3125 52.78125 \nQ 43.3125 58.59375 39.234375 62.25 \nQ 35.15625 65.921875 28.609375 65.921875 \nQ 23.96875 65.921875 18.8125 64.3125 \nQ 13.671875 62.703125 7.8125 59.421875 \nL 7.8125 69.390625 \nQ 13.765625 71.78125 18.9375 73 \nQ 24.125 74.21875 28.421875 74.21875 \nQ 39.75 74.21875 46.484375 68.546875 \nQ 53.21875 62.890625 53.21875 53.421875 \nQ 53.21875 48.921875 51.53125 44.890625 \nQ 49.859375 40.875 45.40625 35.40625 \nQ 44.1875 33.984375 37.640625 27.21875 \nQ 31.109375 20.453125 19.1875 8.296875 \nz\n\" id=\"DejaVuSans-50\"/>\n      </defs>\n      <g transform=\"translate(117.559062 161.497656)scale(0.1 -0.1)\">\n       <use xlink:href=\"#DejaVuSans-50\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"xtick_4\">\n     <g id=\"line2d_7\">\n      <path clip-path=\"url(#p2947b66617)\" d=\"M 159.800313 146.899219 \nL 159.800313 10.999219 \n\" style=\"fill:none;stroke:#b0b0b0;stroke-linecap:square;stroke-width:0.8;\"/>\n     </g>\n     <g id=\"line2d_8\">\n      <g>\n       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"159.800313\" xlink:href=\"#mf9de5ce026\" y=\"146.899219\"/>\n      </g>\n     </g>\n     <g id=\"text_4\">\n      <!-- 3 -->\n      <defs>\n       <path d=\"M 40.578125 39.3125 \nQ 47.65625 37.796875 51.625 33 \nQ 55.609375 28.21875 55.609375 21.1875 \nQ 55.609375 10.40625 48.1875 4.484375 \nQ 40.765625 -1.421875 27.09375 -1.421875 \nQ 22.515625 -1.421875 17.65625 -0.515625 \nQ 12.796875 0.390625 7.625 2.203125 \nL 7.625 11.71875 \nQ 11.71875 9.328125 16.59375 8.109375 \nQ 21.484375 6.890625 26.8125 6.890625 \nQ 36.078125 6.890625 40.9375 10.546875 \nQ 45.796875 14.203125 45.796875 21.1875 \nQ 45.796875 27.640625 41.28125 31.265625 \nQ 36.765625 34.90625 28.71875 34.90625 \nL 20.21875 34.90625 \nL 20.21875 43.015625 \nL 29.109375 43.015625 \nQ 36.375 43.015625 40.234375 45.921875 \nQ 44.09375 48.828125 44.09375 54.296875 \nQ 44.09375 59.90625 40.109375 62.90625 \nQ 36.140625 65.921875 28.71875 65.921875 \nQ 24.65625 65.921875 20.015625 65.03125 \nQ 15.375 64.15625 9.8125 62.3125 \nL 9.8125 71.09375 \nQ 15.4375 72.65625 20.34375 73.4375 \nQ 25.25 74.21875 29.59375 74.21875 \nQ 40.828125 74.21875 47.359375 69.109375 \nQ 53.90625 64.015625 53.90625 55.328125 \nQ 53.90625 49.265625 50.4375 45.09375 \nQ 46.96875 40.921875 40.578125 39.3125 \nz\n\" id=\"DejaVuSans-51\"/>\n      </defs>\n      <g transform=\"translate(156.619063 161.497656)scale(0.1 -0.1)\">\n       <use xlink:href=\"#DejaVuSans-51\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"xtick_5\">\n     <g id=\"line2d_9\">\n      <path clip-path=\"url(#p2947b66617)\" d=\"M 198.860313 146.899219 \nL 198.860313 10.999219 \n\" style=\"fill:none;stroke:#b0b0b0;stroke-linecap:square;stroke-width:0.8;\"/>\n     </g>\n     <g id=\"line2d_10\">\n      <g>\n       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"198.860313\" xlink:href=\"#mf9de5ce026\" y=\"146.899219\"/>\n      </g>\n     </g>\n     <g id=\"text_5\">\n      <!-- 4 -->\n      <defs>\n       <path d=\"M 37.796875 64.3125 \nL 12.890625 25.390625 \nL 37.796875 25.390625 \nz\nM 35.203125 72.90625 \nL 47.609375 72.90625 \nL 47.609375 25.390625 \nL 58.015625 25.390625 \nL 58.015625 17.1875 \nL 47.609375 17.1875 \nL 47.609375 0 \nL 37.796875 0 \nL 37.796875 17.1875 \nL 4.890625 17.1875 \nL 4.890625 26.703125 \nz\n\" id=\"DejaVuSans-52\"/>\n      </defs>\n      <g transform=\"translate(195.679063 161.497656)scale(0.1 -0.1)\">\n       <use xlink:href=\"#DejaVuSans-52\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"xtick_6\">\n     <g id=\"line2d_11\">\n      <path clip-path=\"url(#p2947b66617)\" d=\"M 237.920313 146.899219 \nL 237.920313 10.999219 \n\" style=\"fill:none;stroke:#b0b0b0;stroke-linecap:square;stroke-width:0.8;\"/>\n     </g>\n     <g id=\"line2d_12\">\n      <g>\n       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"237.920313\" xlink:href=\"#mf9de5ce026\" y=\"146.899219\"/>\n      </g>\n     </g>\n     <g id=\"text_6\">\n      <!-- 5 -->\n      <defs>\n       <path d=\"M 10.796875 72.90625 \nL 49.515625 72.90625 \nL 49.515625 64.59375 \nL 19.828125 64.59375 \nL 19.828125 46.734375 \nQ 21.96875 47.46875 24.109375 47.828125 \nQ 26.265625 48.1875 28.421875 48.1875 \nQ 40.625 48.1875 47.75 41.5 \nQ 54.890625 34.8125 54.890625 23.390625 \nQ 54.890625 11.625 47.5625 5.09375 \nQ 40.234375 -1.421875 26.90625 -1.421875 \nQ 22.3125 -1.421875 17.546875 -0.640625 \nQ 12.796875 0.140625 7.71875 1.703125 \nL 7.71875 11.625 \nQ 12.109375 9.234375 16.796875 8.0625 \nQ 21.484375 6.890625 26.703125 6.890625 \nQ 35.15625 6.890625 40.078125 11.328125 \nQ 45.015625 15.765625 45.015625 23.390625 \nQ 45.015625 31 40.078125 35.4375 \nQ 35.15625 39.890625 26.703125 39.890625 \nQ 22.75 39.890625 18.8125 39.015625 \nQ 14.890625 38.140625 10.796875 36.28125 \nz\n\" id=\"DejaVuSans-53\"/>\n      </defs>\n      <g transform=\"translate(234.739063 161.497656)scale(0.1 -0.1)\">\n       <use xlink:href=\"#DejaVuSans-53\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"text_7\">\n     <!-- x -->\n     <defs>\n      <path d=\"M 54.890625 54.6875 \nL 35.109375 28.078125 \nL 55.90625 0 \nL 45.3125 0 \nL 29.390625 21.484375 \nL 13.484375 0 \nL 2.875 0 \nL 24.125 28.609375 \nL 4.6875 54.6875 \nL 15.28125 54.6875 \nL 29.78125 35.203125 \nL 44.28125 54.6875 \nz\n\" id=\"DejaVuSans-120\"/>\n     </defs>\n     <g transform=\"translate(137.310937 175.175781)scale(0.1 -0.1)\">\n      <use xlink:href=\"#DejaVuSans-120\"/>\n     </g>\n    </g>\n   </g>\n   <g id=\"matplotlib.axis_2\">\n    <g id=\"ytick_1\">\n     <g id=\"line2d_13\">\n      <path clip-path=\"url(#p2947b66617)\" d=\"M 42.620312 146.899219 \nL 237.920313 146.899219 \n\" style=\"fill:none;stroke:#b0b0b0;stroke-linecap:square;stroke-width:0.8;\"/>\n     </g>\n     <g id=\"line2d_14\">\n      <defs>\n       <path d=\"M 0 0 \nL -3.5 0 \n\" id=\"m95968aa07a\" style=\"stroke:#000000;stroke-width:0.8;\"/>\n      </defs>\n      <g>\n       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"42.620312\" xlink:href=\"#m95968aa07a\" y=\"146.899219\"/>\n      </g>\n     </g>\n     <g id=\"text_8\">\n      <!-- −1 -->\n      <defs>\n       <path d=\"M 10.59375 35.5 \nL 73.1875 35.5 \nL 73.1875 27.203125 \nL 10.59375 27.203125 \nz\n\" id=\"DejaVuSans-8722\"/>\n      </defs>\n      <g transform=\"translate(20.878125 150.698437)scale(0.1 -0.1)\">\n       <use xlink:href=\"#DejaVuSans-8722\"/>\n       <use x=\"83.789062\" xlink:href=\"#DejaVuSans-49\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"ytick_2\">\n     <g id=\"line2d_15\">\n      <path clip-path=\"url(#p2947b66617)\" d=\"M 42.620312 124.249219 \nL 237.920313 124.249219 \n\" style=\"fill:none;stroke:#b0b0b0;stroke-linecap:square;stroke-width:0.8;\"/>\n     </g>\n     <g id=\"line2d_16\">\n      <g>\n       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"42.620312\" xlink:href=\"#m95968aa07a\" y=\"124.249219\"/>\n      </g>\n     </g>\n     <g id=\"text_9\">\n      <!-- 0 -->\n      <g transform=\"translate(29.257812 128.048437)scale(0.1 -0.1)\">\n       <use xlink:href=\"#DejaVuSans-48\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"ytick_3\">\n     <g id=\"line2d_17\">\n      <path clip-path=\"url(#p2947b66617)\" d=\"M 42.620312 101.599219 \nL 237.920313 101.599219 \n\" style=\"fill:none;stroke:#b0b0b0;stroke-linecap:square;stroke-width:0.8;\"/>\n     </g>\n     <g id=\"line2d_18\">\n      <g>\n       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"42.620312\" xlink:href=\"#m95968aa07a\" y=\"101.599219\"/>\n      </g>\n     </g>\n     <g id=\"text_10\">\n      <!-- 1 -->\n      <g transform=\"translate(29.257812 105.398437)scale(0.1 -0.1)\">\n       <use xlink:href=\"#DejaVuSans-49\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"ytick_4\">\n     <g id=\"line2d_19\">\n      <path clip-path=\"url(#p2947b66617)\" d=\"M 42.620312 78.949219 \nL 237.920313 78.949219 \n\" style=\"fill:none;stroke:#b0b0b0;stroke-linecap:square;stroke-width:0.8;\"/>\n     </g>\n     <g id=\"line2d_20\">\n      <g>\n       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"42.620312\" xlink:href=\"#m95968aa07a\" y=\"78.949219\"/>\n      </g>\n     </g>\n     <g id=\"text_11\">\n      <!-- 2 -->\n      <g transform=\"translate(29.257812 82.748437)scale(0.1 -0.1)\">\n       <use xlink:href=\"#DejaVuSans-50\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"ytick_5\">\n     <g id=\"line2d_21\">\n      <path clip-path=\"url(#p2947b66617)\" d=\"M 42.620312 56.299219 \nL 237.920313 56.299219 \n\" style=\"fill:none;stroke:#b0b0b0;stroke-linecap:square;stroke-width:0.8;\"/>\n     </g>\n     <g id=\"line2d_22\">\n      <g>\n       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"42.620312\" xlink:href=\"#m95968aa07a\" y=\"56.299219\"/>\n      </g>\n     </g>\n     <g id=\"text_12\">\n      <!-- 3 -->\n      <g transform=\"translate(29.257812 60.098437)scale(0.1 -0.1)\">\n       <use xlink:href=\"#DejaVuSans-51\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"ytick_6\">\n     <g id=\"line2d_23\">\n      <path clip-path=\"url(#p2947b66617)\" d=\"M 42.620312 33.649219 \nL 237.920313 33.649219 \n\" style=\"fill:none;stroke:#b0b0b0;stroke-linecap:square;stroke-width:0.8;\"/>\n     </g>\n     <g id=\"line2d_24\">\n      <g>\n       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"42.620312\" xlink:href=\"#m95968aa07a\" y=\"33.649219\"/>\n      </g>\n     </g>\n     <g id=\"text_13\">\n      <!-- 4 -->\n      <g transform=\"translate(29.257812 37.448437)scale(0.1 -0.1)\">\n       <use xlink:href=\"#DejaVuSans-52\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"ytick_7\">\n     <g id=\"line2d_25\">\n      <path clip-path=\"url(#p2947b66617)\" d=\"M 42.620312 10.999219 \nL 237.920313 10.999219 \n\" style=\"fill:none;stroke:#b0b0b0;stroke-linecap:square;stroke-width:0.8;\"/>\n     </g>\n     <g id=\"line2d_26\">\n      <g>\n       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"42.620312\" xlink:href=\"#m95968aa07a\" y=\"10.999219\"/>\n      </g>\n     </g>\n     <g id=\"text_14\">\n      <!-- 5 -->\n      <g transform=\"translate(29.257812 14.798437)scale(0.1 -0.1)\">\n       <use xlink:href=\"#DejaVuSans-53\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"text_15\">\n     <!-- y -->\n     <defs>\n      <path d=\"M 32.171875 -5.078125 \nQ 28.375 -14.84375 24.75 -17.8125 \nQ 21.140625 -20.796875 15.09375 -20.796875 \nL 7.90625 -20.796875 \nL 7.90625 -13.28125 \nL 13.1875 -13.28125 \nQ 16.890625 -13.28125 18.9375 -11.515625 \nQ 21 -9.765625 23.484375 -3.21875 \nL 25.09375 0.875 \nL 2.984375 54.6875 \nL 12.5 54.6875 \nL 29.59375 11.921875 \nL 46.6875 54.6875 \nL 56.203125 54.6875 \nz\n\" id=\"DejaVuSans-121\"/>\n     </defs>\n     <g transform=\"translate(14.798437 81.908594)rotate(-90)scale(0.1 -0.1)\">\n      <use xlink:href=\"#DejaVuSans-121\"/>\n     </g>\n    </g>\n   </g>\n   <g id=\"line2d_27\">\n    <path clip-path=\"url(#p2947b66617)\" d=\"M 42.620312 124.249219 \nL 46.526313 116.136982 \nL 50.432313 108.999323 \nL 54.338313 102.217148 \nL 58.244313 95.726379 \nL 62.150312 89.522233 \nL 66.056313 83.619087 \nL 69.962312 78.038824 \nL 73.868313 72.806 \nL 77.774314 67.945395 \nL 81.680312 63.480584 \nL 85.586313 59.432954 \nL 89.492314 55.821098 \nL 93.398311 52.660258 \nL 97.304312 49.962036 \nL 101.210313 47.734078 \nL 105.116313 45.979911 \nL 109.022314 44.69881 \nL 112.928315 43.885737 \nL 116.834312 43.531371 \nL 120.740313 43.622105 \nL 124.646309 44.140188 \nL 128.552314 45.063873 \nL 132.458311 46.367563 \nL 136.364316 48.022135 \nL 140.270312 49.995107 \nL 144.176318 52.251038 \nL 148.082314 54.751808 \nL 151.98832 57.457039 \nL 155.894316 60.324422 \nL 159.800313 63.310193 \nL 163.706318 66.369546 \nL 167.612314 69.45704 \nL 171.518311 72.527086 \nL 175.424316 75.534393 \nL 179.330312 78.434371 \nL 183.236318 81.183652 \nL 187.142314 83.740416 \nL 191.048311 86.06491 \nL 194.954316 88.119776 \nL 198.860313 89.870412 \nL 202.766309 91.285368 \nL 206.672305 92.336626 \nL 210.57832 92.999866 \nL 214.484316 93.254719 \nL 218.390312 93.084986 \nL 222.296309 92.478756 \nL 226.202305 91.428572 \nL 230.10832 89.931453 \nL 234.014316 87.988973 \n\" style=\"fill:none;stroke:#1f77b4;stroke-linecap:square;stroke-width:1.5;\"/>\n   </g>\n   <g id=\"line2d_28\">\n    <path clip-path=\"url(#p2947b66617)\" d=\"M 42.620312 72.179088 \nL 46.526313 71.151525 \nL 50.432313 70.08695 \nL 54.338313 68.989941 \nL 58.244313 67.866179 \nL 62.150312 66.722443 \nL 66.056313 65.56662 \nL 69.962312 64.407682 \nL 73.868313 63.255613 \nL 77.774314 62.121316 \nL 81.680312 61.016455 \nL 85.586313 59.953332 \nL 89.492314 58.944681 \nL 93.398311 58.003478 \nL 97.304312 57.142722 \nL 101.210313 56.375275 \nL 105.116313 55.713504 \nL 109.022314 55.16915 \nL 112.928315 54.753028 \nL 116.834312 54.474724 \nL 120.740313 54.342312 \nL 124.646309 54.362023 \nL 128.552314 54.537939 \nL 132.458311 54.871611 \nL 136.364316 55.361801 \nL 140.270312 56.004185 \nL 144.176318 56.791272 \nL 148.082314 57.712349 \nL 151.98832 58.753617 \nL 155.894316 59.898569 \nL 159.800313 61.128449 \nL 163.706318 62.422927 \nL 167.612314 63.7608 \nL 171.518311 65.1209 \nL 175.424316 66.482766 \nL 179.330312 67.827352 \nL 183.236318 69.137598 \nL 187.142314 70.398859 \nL 191.048311 71.59906 \nL 194.954316 72.728815 \nL 198.860313 73.781321 \nL 202.766309 74.752198 \nL 206.672305 75.639221 \nL 210.57832 76.442055 \nL 214.484316 77.161889 \nL 218.390312 77.801243 \nL 222.296309 78.363575 \nL 226.202305 78.853106 \nL 230.10832 79.274585 \nL 234.014316 79.633076 \n\" style=\"fill:none;stroke:#bf00bf;stroke-dasharray:5.55,2.4;stroke-dashoffset:0;stroke-width:1.5;\"/>\n   </g>\n   <g id=\"line2d_29\">\n    <defs>\n     <path d=\"M 0 3 \nC 0.795609 3 1.55874 2.683901 2.12132 2.12132 \nC 2.683901 1.55874 3 0.795609 3 0 \nC 3 -0.795609 2.683901 -1.55874 2.12132 -2.12132 \nC 1.55874 -2.683901 0.795609 -3 0 -3 \nC -0.795609 -3 -1.55874 -2.683901 -2.12132 -2.12132 \nC -2.683901 -1.55874 -3 -0.795609 -3 0 \nC -3 0.795609 -2.683901 1.55874 -2.12132 2.12132 \nC -1.55874 2.683901 -0.795609 3 0 3 \nz\n\" id=\"m102c8fd613\" style=\"stroke:#ff7f0e;stroke-opacity:0.5;\"/>\n    </defs>\n    <g clip-path=\"url(#p2947b66617)\">\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"57.227417\" xlink:href=\"#m102c8fd613\" y=\"86.054806\"/>\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"58.094818\" xlink:href=\"#m102c8fd613\" y=\"94.550419\"/>\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"58.378528\" xlink:href=\"#m102c8fd613\" y=\"99.183761\"/>\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"61.559268\" xlink:href=\"#m102c8fd613\" y=\"80.290842\"/>\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"61.669995\" xlink:href=\"#m102c8fd613\" y=\"94.281191\"/>\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"62.106967\" xlink:href=\"#m102c8fd613\" y=\"78.474019\"/>\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"63.50293\" xlink:href=\"#m102c8fd613\" y=\"77.736592\"/>\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"66.629448\" xlink:href=\"#m102c8fd613\" y=\"93.017694\"/>\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"67.547324\" xlink:href=\"#m102c8fd613\" y=\"81.544259\"/>\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"74.548966\" xlink:href=\"#m102c8fd613\" y=\"78.756935\"/>\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"79.19761\" xlink:href=\"#m102c8fd613\" y=\"65.54637\"/>\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"82.758203\" xlink:href=\"#m102c8fd613\" y=\"65.287226\"/>\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"87.728959\" xlink:href=\"#m102c8fd613\" y=\"39.192585\"/>\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"96.636908\" xlink:href=\"#m102c8fd613\" y=\"61.057534\"/>\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"100.850812\" xlink:href=\"#m102c8fd613\" y=\"41.745807\"/>\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"103.226883\" xlink:href=\"#m102c8fd613\" y=\"45.203176\"/>\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"105.008296\" xlink:href=\"#m102c8fd613\" y=\"17.397591\"/>\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"105.19826\" xlink:href=\"#m102c8fd613\" y=\"37.219494\"/>\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"105.274046\" xlink:href=\"#m102c8fd613\" y=\"52.471025\"/>\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"107.624377\" xlink:href=\"#m102c8fd613\" y=\"44.95717\"/>\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"110.088583\" xlink:href=\"#m102c8fd613\" y=\"49.486896\"/>\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"112.502044\" xlink:href=\"#m102c8fd613\" y=\"51.095799\"/>\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"115.543651\" xlink:href=\"#m102c8fd613\" y=\"39.379707\"/>\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"116.068595\" xlink:href=\"#m102c8fd613\" y=\"36.774131\"/>\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"120.220463\" xlink:href=\"#m102c8fd613\" y=\"37.887896\"/>\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"124.697323\" xlink:href=\"#m102c8fd613\" y=\"54.664325\"/>\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"126.683642\" xlink:href=\"#m102c8fd613\" y=\"44.087228\"/>\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"128.566777\" xlink:href=\"#m102c8fd613\" y=\"47.897666\"/>\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"132.243394\" xlink:href=\"#m102c8fd613\" y=\"51.144141\"/>\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"134.251951\" xlink:href=\"#m102c8fd613\" y=\"39.51685\"/>\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"134.784475\" xlink:href=\"#m102c8fd613\" y=\"47.0668\"/>\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"138.165174\" xlink:href=\"#m102c8fd613\" y=\"31.170827\"/>\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"149.407781\" xlink:href=\"#m102c8fd613\" y=\"54.17124\"/>\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"165.238981\" xlink:href=\"#m102c8fd613\" y=\"73.108734\"/>\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"166.60222\" xlink:href=\"#m102c8fd613\" y=\"81.738185\"/>\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"168.585251\" xlink:href=\"#m102c8fd613\" y=\"62.365814\"/>\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"169.344305\" xlink:href=\"#m102c8fd613\" y=\"56.057247\"/>\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"175.803154\" xlink:href=\"#m102c8fd613\" y=\"72.893974\"/>\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"177.333918\" xlink:href=\"#m102c8fd613\" y=\"57.874025\"/>\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"182.188414\" xlink:href=\"#m102c8fd613\" y=\"84.215918\"/>\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"186.843761\" xlink:href=\"#m102c8fd613\" y=\"91.090521\"/>\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"189.515601\" xlink:href=\"#m102c8fd613\" y=\"111.352993\"/>\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"190.372204\" xlink:href=\"#m102c8fd613\" y=\"79.613862\"/>\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"192.53008\" xlink:href=\"#m102c8fd613\" y=\"69.098679\"/>\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"203.411004\" xlink:href=\"#m102c8fd613\" y=\"101.960855\"/>\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"209.29381\" xlink:href=\"#m102c8fd613\" y=\"82.990244\"/>\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"229.549041\" xlink:href=\"#m102c8fd613\" y=\"78.088074\"/>\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"229.834119\" xlink:href=\"#m102c8fd613\" y=\"75.026041\"/>\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"232.208914\" xlink:href=\"#m102c8fd613\" y=\"76.215161\"/>\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"232.414574\" xlink:href=\"#m102c8fd613\" y=\"86.656578\"/>\n    </g>\n   </g>\n   <g id=\"patch_3\">\n    <path d=\"M 42.620312 146.899219 \nL 42.620312 10.999219 \n\" style=\"fill:none;stroke:#000000;stroke-linecap:square;stroke-linejoin:miter;stroke-width:0.8;\"/>\n   </g>\n   <g id=\"patch_4\">\n    <path d=\"M 237.920313 146.899219 \nL 237.920313 10.999219 \n\" style=\"fill:none;stroke:#000000;stroke-linecap:square;stroke-linejoin:miter;stroke-width:0.8;\"/>\n   </g>\n   <g id=\"patch_5\">\n    <path d=\"M 42.620312 146.899219 \nL 237.920313 146.899219 \n\" style=\"fill:none;stroke:#000000;stroke-linecap:square;stroke-linejoin:miter;stroke-width:0.8;\"/>\n   </g>\n   <g id=\"patch_6\">\n    <path d=\"M 42.620312 10.999219 \nL 237.920313 10.999219 \n\" style=\"fill:none;stroke:#000000;stroke-linecap:square;stroke-linejoin:miter;stroke-width:0.8;\"/>\n   </g>\n   <g id=\"legend_1\">\n    <g id=\"patch_7\">\n     <path d=\"M 173.58125 48.355469 \nL 230.920313 48.355469 \nQ 232.920313 48.355469 232.920313 46.355469 \nL 232.920313 17.999219 \nQ 232.920313 15.999219 230.920313 15.999219 \nL 173.58125 15.999219 \nQ 171.58125 15.999219 171.58125 17.999219 \nL 171.58125 46.355469 \nQ 171.58125 48.355469 173.58125 48.355469 \nz\n\" style=\"fill:#ffffff;opacity:0.8;stroke:#cccccc;stroke-linejoin:miter;\"/>\n    </g>\n    <g id=\"line2d_30\">\n     <path d=\"M 175.58125 24.097656 \nL 195.58125 24.097656 \n\" style=\"fill:none;stroke:#1f77b4;stroke-linecap:square;stroke-width:1.5;\"/>\n    </g>\n    <g id=\"line2d_31\"/>\n    <g id=\"text_16\">\n     <!-- Truth -->\n     <defs>\n      <path d=\"M -0.296875 72.90625 \nL 61.375 72.90625 \nL 61.375 64.59375 \nL 35.5 64.59375 \nL 35.5 0 \nL 25.59375 0 \nL 25.59375 64.59375 \nL -0.296875 64.59375 \nz\n\" id=\"DejaVuSans-84\"/>\n      <path d=\"M 41.109375 46.296875 \nQ 39.59375 47.171875 37.8125 47.578125 \nQ 36.03125 48 33.890625 48 \nQ 26.265625 48 22.1875 43.046875 \nQ 18.109375 38.09375 18.109375 28.8125 \nL 18.109375 0 \nL 9.078125 0 \nL 9.078125 54.6875 \nL 18.109375 54.6875 \nL 18.109375 46.1875 \nQ 20.953125 51.171875 25.484375 53.578125 \nQ 30.03125 56 36.53125 56 \nQ 37.453125 56 38.578125 55.875 \nQ 39.703125 55.765625 41.0625 55.515625 \nz\n\" id=\"DejaVuSans-114\"/>\n      <path d=\"M 8.5 21.578125 \nL 8.5 54.6875 \nL 17.484375 54.6875 \nL 17.484375 21.921875 \nQ 17.484375 14.15625 20.5 10.265625 \nQ 23.53125 6.390625 29.59375 6.390625 \nQ 36.859375 6.390625 41.078125 11.03125 \nQ 45.3125 15.671875 45.3125 23.6875 \nL 45.3125 54.6875 \nL 54.296875 54.6875 \nL 54.296875 0 \nL 45.3125 0 \nL 45.3125 8.40625 \nQ 42.046875 3.421875 37.71875 1 \nQ 33.40625 -1.421875 27.6875 -1.421875 \nQ 18.265625 -1.421875 13.375 4.4375 \nQ 8.5 10.296875 8.5 21.578125 \nz\nM 31.109375 56 \nz\n\" id=\"DejaVuSans-117\"/>\n      <path d=\"M 18.3125 70.21875 \nL 18.3125 54.6875 \nL 36.8125 54.6875 \nL 36.8125 47.703125 \nL 18.3125 47.703125 \nL 18.3125 18.015625 \nQ 18.3125 11.328125 20.140625 9.421875 \nQ 21.96875 7.515625 27.59375 7.515625 \nL 36.8125 7.515625 \nL 36.8125 0 \nL 27.59375 0 \nQ 17.1875 0 13.234375 3.875 \nQ 9.28125 7.765625 9.28125 18.015625 \nL 9.28125 47.703125 \nL 2.6875 47.703125 \nL 2.6875 54.6875 \nL 9.28125 54.6875 \nL 9.28125 70.21875 \nz\n\" id=\"DejaVuSans-116\"/>\n      <path d=\"M 54.890625 33.015625 \nL 54.890625 0 \nL 45.90625 0 \nL 45.90625 32.71875 \nQ 45.90625 40.484375 42.875 44.328125 \nQ 39.84375 48.1875 33.796875 48.1875 \nQ 26.515625 48.1875 22.3125 43.546875 \nQ 18.109375 38.921875 18.109375 30.90625 \nL 18.109375 0 \nL 9.078125 0 \nL 9.078125 75.984375 \nL 18.109375 75.984375 \nL 18.109375 46.1875 \nQ 21.34375 51.125 25.703125 53.5625 \nQ 30.078125 56 35.796875 56 \nQ 45.21875 56 50.046875 50.171875 \nQ 54.890625 44.34375 54.890625 33.015625 \nz\n\" id=\"DejaVuSans-104\"/>\n     </defs>\n     <g transform=\"translate(203.58125 27.597656)scale(0.1 -0.1)\">\n      <use xlink:href=\"#DejaVuSans-84\"/>\n      <use x=\"46.333984\" xlink:href=\"#DejaVuSans-114\"/>\n      <use x=\"87.447266\" xlink:href=\"#DejaVuSans-117\"/>\n      <use x=\"150.826172\" xlink:href=\"#DejaVuSans-116\"/>\n      <use x=\"190.035156\" xlink:href=\"#DejaVuSans-104\"/>\n     </g>\n    </g>\n    <g id=\"line2d_32\">\n     <path d=\"M 175.58125 38.775781 \nL 195.58125 38.775781 \n\" style=\"fill:none;stroke:#bf00bf;stroke-dasharray:5.55,2.4;stroke-dashoffset:0;stroke-width:1.5;\"/>\n    </g>\n    <g id=\"line2d_33\"/>\n    <g id=\"text_17\">\n     <!-- Pred -->\n     <defs>\n      <path d=\"M 19.671875 64.796875 \nL 19.671875 37.40625 \nL 32.078125 37.40625 \nQ 38.96875 37.40625 42.71875 40.96875 \nQ 46.484375 44.53125 46.484375 51.125 \nQ 46.484375 57.671875 42.71875 61.234375 \nQ 38.96875 64.796875 32.078125 64.796875 \nz\nM 9.8125 72.90625 \nL 32.078125 72.90625 \nQ 44.34375 72.90625 50.609375 67.359375 \nQ 56.890625 61.8125 56.890625 51.125 \nQ 56.890625 40.328125 50.609375 34.8125 \nQ 44.34375 29.296875 32.078125 29.296875 \nL 19.671875 29.296875 \nL 19.671875 0 \nL 9.8125 0 \nz\n\" id=\"DejaVuSans-80\"/>\n      <path d=\"M 56.203125 29.59375 \nL 56.203125 25.203125 \nL 14.890625 25.203125 \nQ 15.484375 15.921875 20.484375 11.0625 \nQ 25.484375 6.203125 34.421875 6.203125 \nQ 39.59375 6.203125 44.453125 7.46875 \nQ 49.3125 8.734375 54.109375 11.28125 \nL 54.109375 2.78125 \nQ 49.265625 0.734375 44.1875 -0.34375 \nQ 39.109375 -1.421875 33.890625 -1.421875 \nQ 20.796875 -1.421875 13.15625 6.1875 \nQ 5.515625 13.8125 5.515625 26.8125 \nQ 5.515625 40.234375 12.765625 48.109375 \nQ 20.015625 56 32.328125 56 \nQ 43.359375 56 49.78125 48.890625 \nQ 56.203125 41.796875 56.203125 29.59375 \nz\nM 47.21875 32.234375 \nQ 47.125 39.59375 43.09375 43.984375 \nQ 39.0625 48.390625 32.421875 48.390625 \nQ 24.90625 48.390625 20.390625 44.140625 \nQ 15.875 39.890625 15.1875 32.171875 \nz\n\" id=\"DejaVuSans-101\"/>\n      <path d=\"M 45.40625 46.390625 \nL 45.40625 75.984375 \nL 54.390625 75.984375 \nL 54.390625 0 \nL 45.40625 0 \nL 45.40625 8.203125 \nQ 42.578125 3.328125 38.25 0.953125 \nQ 33.9375 -1.421875 27.875 -1.421875 \nQ 17.96875 -1.421875 11.734375 6.484375 \nQ 5.515625 14.40625 5.515625 27.296875 \nQ 5.515625 40.1875 11.734375 48.09375 \nQ 17.96875 56 27.875 56 \nQ 33.9375 56 38.25 53.625 \nQ 42.578125 51.265625 45.40625 46.390625 \nz\nM 14.796875 27.296875 \nQ 14.796875 17.390625 18.875 11.75 \nQ 22.953125 6.109375 30.078125 6.109375 \nQ 37.203125 6.109375 41.296875 11.75 \nQ 45.40625 17.390625 45.40625 27.296875 \nQ 45.40625 37.203125 41.296875 42.84375 \nQ 37.203125 48.484375 30.078125 48.484375 \nQ 22.953125 48.484375 18.875 42.84375 \nQ 14.796875 37.203125 14.796875 27.296875 \nz\n\" id=\"DejaVuSans-100\"/>\n     </defs>\n     <g transform=\"translate(203.58125 42.275781)scale(0.1 -0.1)\">\n      <use xlink:href=\"#DejaVuSans-80\"/>\n      <use x=\"58.552734\" xlink:href=\"#DejaVuSans-114\"/>\n      <use x=\"97.416016\" xlink:href=\"#DejaVuSans-101\"/>\n      <use x=\"158.939453\" xlink:href=\"#DejaVuSans-100\"/>\n     </g>\n    </g>\n   </g>\n  </g>\n </g>\n <defs>\n  <clipPath id=\"p2947b66617\">\n   <rect height=\"135.9\" width=\"195.3\" x=\"42.620312\" y=\"10.999219\"/>\n  </clipPath>\n </defs>\n</svg>\n",
            "text/plain": [
              "<Figure size 252x180 with 1 Axes>"
            ]
          },
          "metadata": {
            "needs_background": "light"
          },
          "output_type": "display_data"
        }
      ],
      "source": [
        "# X_repeat的形状：（n_test,n_train）,\n",
        "# 每一行都包含着相同的测试输入（例如：同样的查询）\n",
        "X_repeat = x_test.repeat_interleave(n_train).reshape((-1,n_train))\n",
        "# x_train包含着键。attention_weights的形状：（n_test,n_train）,\n",
        "# 每一行都包含着要在给定的每个查询的值（y_train）之间分配的注意力权重\n",
        "attention_weights = nn.functional.softmax(-(X_repeat-x_train)**2 / 2,dim=1)\n",
        "# y_hat的每个元素都是值的加权平均值，其中的权重是注意力权重\n",
        "y_hat = torch.matmul(attention_weights,y_train)\n",
        "plot_kernel_reg(y_hat)"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "7C77gUJmBn6u"
      },
      "source": [
        "\n",
        "*   测试数据的输入相当于查询\n",
        "*   训练数据的输入相当于键\n",
        "\n",
        "“查询——键”对越接近，注意力汇聚的注意力权重越高\n",
        "\n"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 232
        },
        "id": "mU8NV5Yp2_r7",
        "outputId": "dafd509a-789a-44b6-96f4-a79b68738ee7"
      },
      "outputs": [
        {
          "data": {
            "image/svg+xml": "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"no\"?>\n<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\"\n  \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">\n<!-- Created with matplotlib (https://matplotlib.org/) -->\n<svg height=\"159.039469pt\" version=\"1.1\" viewBox=\"0 0 206.08325 159.039469\" width=\"206.08325pt\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n <defs>\n  <style type=\"text/css\">\n*{stroke-linecap:butt;stroke-linejoin:round;}\n  </style>\n </defs>\n <g id=\"figure_1\">\n  <g id=\"patch_1\">\n   <path d=\"M 0 159.039469 \nL 206.08325 159.039469 \nL 206.08325 0 \nL 0 0 \nz\n\" style=\"fill:none;\"/>\n  </g>\n  <g id=\"axes_1\">\n   <g id=\"patch_2\">\n    <path d=\"M 40.603125 121.483219 \nL 152.203125 121.483219 \nL 152.203125 9.883219 \nL 40.603125 9.883219 \nz\n\" style=\"fill:#ffffff;\"/>\n   </g>\n   <g clip-path=\"url(#p632e6ce747)\">\n    <image height=\"112\" id=\"imageb9ec536567\" transform=\"scale(1 -1)translate(0 -112)\" width=\"112\" x=\"40.603125\" xlink:href=\"data:image/png;base64,\n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\" y=\"-9.483219\"/>\n   </g>\n   <g id=\"matplotlib.axis_1\">\n    <g id=\"xtick_1\">\n     <g id=\"line2d_1\">\n      <defs>\n       <path d=\"M 0 0 \nL 0 3.5 \n\" id=\"m1dd2e5d3fb\" style=\"stroke:#000000;stroke-width:0.8;\"/>\n      </defs>\n      <g>\n       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"41.719125\" xlink:href=\"#m1dd2e5d3fb\" y=\"121.483219\"/>\n      </g>\n     </g>\n     <g id=\"text_1\">\n      <!-- 0 -->\n      <defs>\n       <path d=\"M 31.78125 66.40625 \nQ 24.171875 66.40625 20.328125 58.90625 \nQ 16.5 51.421875 16.5 36.375 \nQ 16.5 21.390625 20.328125 13.890625 \nQ 24.171875 6.390625 31.78125 6.390625 \nQ 39.453125 6.390625 43.28125 13.890625 \nQ 47.125 21.390625 47.125 36.375 \nQ 47.125 51.421875 43.28125 58.90625 \nQ 39.453125 66.40625 31.78125 66.40625 \nz\nM 31.78125 74.21875 \nQ 44.046875 74.21875 50.515625 64.515625 \nQ 56.984375 54.828125 56.984375 36.375 \nQ 56.984375 17.96875 50.515625 8.265625 \nQ 44.046875 -1.421875 31.78125 -1.421875 \nQ 19.53125 -1.421875 13.0625 8.265625 \nQ 6.59375 17.96875 6.59375 36.375 \nQ 6.59375 54.828125 13.0625 64.515625 \nQ 19.53125 74.21875 31.78125 74.21875 \nz\n\" id=\"DejaVuSans-48\"/>\n      </defs>\n      <g transform=\"translate(38.537875 136.081656)scale(0.1 -0.1)\">\n       <use xlink:href=\"#DejaVuSans-48\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"xtick_2\">\n     <g id=\"line2d_2\">\n      <g>\n       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"86.359125\" xlink:href=\"#m1dd2e5d3fb\" y=\"121.483219\"/>\n      </g>\n     </g>\n     <g id=\"text_2\">\n      <!-- 20 -->\n      <defs>\n       <path d=\"M 19.1875 8.296875 \nL 53.609375 8.296875 \nL 53.609375 0 \nL 7.328125 0 \nL 7.328125 8.296875 \nQ 12.9375 14.109375 22.625 23.890625 \nQ 32.328125 33.6875 34.8125 36.53125 \nQ 39.546875 41.84375 41.421875 45.53125 \nQ 43.3125 49.21875 43.3125 52.78125 \nQ 43.3125 58.59375 39.234375 62.25 \nQ 35.15625 65.921875 28.609375 65.921875 \nQ 23.96875 65.921875 18.8125 64.3125 \nQ 13.671875 62.703125 7.8125 59.421875 \nL 7.8125 69.390625 \nQ 13.765625 71.78125 18.9375 73 \nQ 24.125 74.21875 28.421875 74.21875 \nQ 39.75 74.21875 46.484375 68.546875 \nQ 53.21875 62.890625 53.21875 53.421875 \nQ 53.21875 48.921875 51.53125 44.890625 \nQ 49.859375 40.875 45.40625 35.40625 \nQ 44.1875 33.984375 37.640625 27.21875 \nQ 31.109375 20.453125 19.1875 8.296875 \nz\n\" id=\"DejaVuSans-50\"/>\n      </defs>\n      <g transform=\"translate(79.996625 136.081656)scale(0.1 -0.1)\">\n       <use xlink:href=\"#DejaVuSans-50\"/>\n       <use x=\"63.623047\" xlink:href=\"#DejaVuSans-48\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"xtick_3\">\n     <g id=\"line2d_3\">\n      <g>\n       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"130.999125\" xlink:href=\"#m1dd2e5d3fb\" y=\"121.483219\"/>\n      </g>\n     </g>\n     <g id=\"text_3\">\n      <!-- 40 -->\n      <defs>\n       <path d=\"M 37.796875 64.3125 \nL 12.890625 25.390625 \nL 37.796875 25.390625 \nz\nM 35.203125 72.90625 \nL 47.609375 72.90625 \nL 47.609375 25.390625 \nL 58.015625 25.390625 \nL 58.015625 17.1875 \nL 47.609375 17.1875 \nL 47.609375 0 \nL 37.796875 0 \nL 37.796875 17.1875 \nL 4.890625 17.1875 \nL 4.890625 26.703125 \nz\n\" id=\"DejaVuSans-52\"/>\n      </defs>\n      <g transform=\"translate(124.636625 136.081656)scale(0.1 -0.1)\">\n       <use xlink:href=\"#DejaVuSans-52\"/>\n       <use x=\"63.623047\" xlink:href=\"#DejaVuSans-48\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"text_4\">\n     <!-- Sorted training inputs -->\n     <defs>\n      <path d=\"M 53.515625 70.515625 \nL 53.515625 60.890625 \nQ 47.90625 63.578125 42.921875 64.890625 \nQ 37.9375 66.21875 33.296875 66.21875 \nQ 25.25 66.21875 20.875 63.09375 \nQ 16.5 59.96875 16.5 54.203125 \nQ 16.5 49.359375 19.40625 46.890625 \nQ 22.3125 44.4375 30.421875 42.921875 \nL 36.375 41.703125 \nQ 47.40625 39.59375 52.65625 34.296875 \nQ 57.90625 29 57.90625 20.125 \nQ 57.90625 9.515625 50.796875 4.046875 \nQ 43.703125 -1.421875 29.984375 -1.421875 \nQ 24.8125 -1.421875 18.96875 -0.25 \nQ 13.140625 0.921875 6.890625 3.21875 \nL 6.890625 13.375 \nQ 12.890625 10.015625 18.65625 8.296875 \nQ 24.421875 6.59375 29.984375 6.59375 \nQ 38.421875 6.59375 43.015625 9.90625 \nQ 47.609375 13.234375 47.609375 19.390625 \nQ 47.609375 24.75 44.3125 27.78125 \nQ 41.015625 30.8125 33.5 32.328125 \nL 27.484375 33.5 \nQ 16.453125 35.6875 11.515625 40.375 \nQ 6.59375 45.0625 6.59375 53.421875 \nQ 6.59375 63.09375 13.40625 68.65625 \nQ 20.21875 74.21875 32.171875 74.21875 \nQ 37.3125 74.21875 42.625 73.28125 \nQ 47.953125 72.359375 53.515625 70.515625 \nz\n\" id=\"DejaVuSans-83\"/>\n      <path d=\"M 30.609375 48.390625 \nQ 23.390625 48.390625 19.1875 42.75 \nQ 14.984375 37.109375 14.984375 27.296875 \nQ 14.984375 17.484375 19.15625 11.84375 \nQ 23.34375 6.203125 30.609375 6.203125 \nQ 37.796875 6.203125 41.984375 11.859375 \nQ 46.1875 17.53125 46.1875 27.296875 \nQ 46.1875 37.015625 41.984375 42.703125 \nQ 37.796875 48.390625 30.609375 48.390625 \nz\nM 30.609375 56 \nQ 42.328125 56 49.015625 48.375 \nQ 55.71875 40.765625 55.71875 27.296875 \nQ 55.71875 13.875 49.015625 6.21875 \nQ 42.328125 -1.421875 30.609375 -1.421875 \nQ 18.84375 -1.421875 12.171875 6.21875 \nQ 5.515625 13.875 5.515625 27.296875 \nQ 5.515625 40.765625 12.171875 48.375 \nQ 18.84375 56 30.609375 56 \nz\n\" id=\"DejaVuSans-111\"/>\n      <path d=\"M 41.109375 46.296875 \nQ 39.59375 47.171875 37.8125 47.578125 \nQ 36.03125 48 33.890625 48 \nQ 26.265625 48 22.1875 43.046875 \nQ 18.109375 38.09375 18.109375 28.8125 \nL 18.109375 0 \nL 9.078125 0 \nL 9.078125 54.6875 \nL 18.109375 54.6875 \nL 18.109375 46.1875 \nQ 20.953125 51.171875 25.484375 53.578125 \nQ 30.03125 56 36.53125 56 \nQ 37.453125 56 38.578125 55.875 \nQ 39.703125 55.765625 41.0625 55.515625 \nz\n\" id=\"DejaVuSans-114\"/>\n      <path d=\"M 18.3125 70.21875 \nL 18.3125 54.6875 \nL 36.8125 54.6875 \nL 36.8125 47.703125 \nL 18.3125 47.703125 \nL 18.3125 18.015625 \nQ 18.3125 11.328125 20.140625 9.421875 \nQ 21.96875 7.515625 27.59375 7.515625 \nL 36.8125 7.515625 \nL 36.8125 0 \nL 27.59375 0 \nQ 17.1875 0 13.234375 3.875 \nQ 9.28125 7.765625 9.28125 18.015625 \nL 9.28125 47.703125 \nL 2.6875 47.703125 \nL 2.6875 54.6875 \nL 9.28125 54.6875 \nL 9.28125 70.21875 \nz\n\" id=\"DejaVuSans-116\"/>\n      <path d=\"M 56.203125 29.59375 \nL 56.203125 25.203125 \nL 14.890625 25.203125 \nQ 15.484375 15.921875 20.484375 11.0625 \nQ 25.484375 6.203125 34.421875 6.203125 \nQ 39.59375 6.203125 44.453125 7.46875 \nQ 49.3125 8.734375 54.109375 11.28125 \nL 54.109375 2.78125 \nQ 49.265625 0.734375 44.1875 -0.34375 \nQ 39.109375 -1.421875 33.890625 -1.421875 \nQ 20.796875 -1.421875 13.15625 6.1875 \nQ 5.515625 13.8125 5.515625 26.8125 \nQ 5.515625 40.234375 12.765625 48.109375 \nQ 20.015625 56 32.328125 56 \nQ 43.359375 56 49.78125 48.890625 \nQ 56.203125 41.796875 56.203125 29.59375 \nz\nM 47.21875 32.234375 \nQ 47.125 39.59375 43.09375 43.984375 \nQ 39.0625 48.390625 32.421875 48.390625 \nQ 24.90625 48.390625 20.390625 44.140625 \nQ 15.875 39.890625 15.1875 32.171875 \nz\n\" id=\"DejaVuSans-101\"/>\n      <path d=\"M 45.40625 46.390625 \nL 45.40625 75.984375 \nL 54.390625 75.984375 \nL 54.390625 0 \nL 45.40625 0 \nL 45.40625 8.203125 \nQ 42.578125 3.328125 38.25 0.953125 \nQ 33.9375 -1.421875 27.875 -1.421875 \nQ 17.96875 -1.421875 11.734375 6.484375 \nQ 5.515625 14.40625 5.515625 27.296875 \nQ 5.515625 40.1875 11.734375 48.09375 \nQ 17.96875 56 27.875 56 \nQ 33.9375 56 38.25 53.625 \nQ 42.578125 51.265625 45.40625 46.390625 \nz\nM 14.796875 27.296875 \nQ 14.796875 17.390625 18.875 11.75 \nQ 22.953125 6.109375 30.078125 6.109375 \nQ 37.203125 6.109375 41.296875 11.75 \nQ 45.40625 17.390625 45.40625 27.296875 \nQ 45.40625 37.203125 41.296875 42.84375 \nQ 37.203125 48.484375 30.078125 48.484375 \nQ 22.953125 48.484375 18.875 42.84375 \nQ 14.796875 37.203125 14.796875 27.296875 \nz\n\" id=\"DejaVuSans-100\"/>\n      <path id=\"DejaVuSans-32\"/>\n      <path d=\"M 34.28125 27.484375 \nQ 23.390625 27.484375 19.1875 25 \nQ 14.984375 22.515625 14.984375 16.5 \nQ 14.984375 11.71875 18.140625 8.90625 \nQ 21.296875 6.109375 26.703125 6.109375 \nQ 34.1875 6.109375 38.703125 11.40625 \nQ 43.21875 16.703125 43.21875 25.484375 \nL 43.21875 27.484375 \nz\nM 52.203125 31.203125 \nL 52.203125 0 \nL 43.21875 0 \nL 43.21875 8.296875 \nQ 40.140625 3.328125 35.546875 0.953125 \nQ 30.953125 -1.421875 24.3125 -1.421875 \nQ 15.921875 -1.421875 10.953125 3.296875 \nQ 6 8.015625 6 15.921875 \nQ 6 25.140625 12.171875 29.828125 \nQ 18.359375 34.515625 30.609375 34.515625 \nL 43.21875 34.515625 \nL 43.21875 35.40625 \nQ 43.21875 41.609375 39.140625 45 \nQ 35.0625 48.390625 27.6875 48.390625 \nQ 23 48.390625 18.546875 47.265625 \nQ 14.109375 46.140625 10.015625 43.890625 \nL 10.015625 52.203125 \nQ 14.9375 54.109375 19.578125 55.046875 \nQ 24.21875 56 28.609375 56 \nQ 40.484375 56 46.34375 49.84375 \nQ 52.203125 43.703125 52.203125 31.203125 \nz\n\" id=\"DejaVuSans-97\"/>\n      <path d=\"M 9.421875 54.6875 \nL 18.40625 54.6875 \nL 18.40625 0 \nL 9.421875 0 \nz\nM 9.421875 75.984375 \nL 18.40625 75.984375 \nL 18.40625 64.59375 \nL 9.421875 64.59375 \nz\n\" id=\"DejaVuSans-105\"/>\n      <path d=\"M 54.890625 33.015625 \nL 54.890625 0 \nL 45.90625 0 \nL 45.90625 32.71875 \nQ 45.90625 40.484375 42.875 44.328125 \nQ 39.84375 48.1875 33.796875 48.1875 \nQ 26.515625 48.1875 22.3125 43.546875 \nQ 18.109375 38.921875 18.109375 30.90625 \nL 18.109375 0 \nL 9.078125 0 \nL 9.078125 54.6875 \nL 18.109375 54.6875 \nL 18.109375 46.1875 \nQ 21.34375 51.125 25.703125 53.5625 \nQ 30.078125 56 35.796875 56 \nQ 45.21875 56 50.046875 50.171875 \nQ 54.890625 44.34375 54.890625 33.015625 \nz\n\" id=\"DejaVuSans-110\"/>\n      <path d=\"M 45.40625 27.984375 \nQ 45.40625 37.75 41.375 43.109375 \nQ 37.359375 48.484375 30.078125 48.484375 \nQ 22.859375 48.484375 18.828125 43.109375 \nQ 14.796875 37.75 14.796875 27.984375 \nQ 14.796875 18.265625 18.828125 12.890625 \nQ 22.859375 7.515625 30.078125 7.515625 \nQ 37.359375 7.515625 41.375 12.890625 \nQ 45.40625 18.265625 45.40625 27.984375 \nz\nM 54.390625 6.78125 \nQ 54.390625 -7.171875 48.1875 -13.984375 \nQ 42 -20.796875 29.203125 -20.796875 \nQ 24.46875 -20.796875 20.265625 -20.09375 \nQ 16.0625 -19.390625 12.109375 -17.921875 \nL 12.109375 -9.1875 \nQ 16.0625 -11.328125 19.921875 -12.34375 \nQ 23.78125 -13.375 27.78125 -13.375 \nQ 36.625 -13.375 41.015625 -8.765625 \nQ 45.40625 -4.15625 45.40625 5.171875 \nL 45.40625 9.625 \nQ 42.625 4.78125 38.28125 2.390625 \nQ 33.9375 0 27.875 0 \nQ 17.828125 0 11.671875 7.65625 \nQ 5.515625 15.328125 5.515625 27.984375 \nQ 5.515625 40.671875 11.671875 48.328125 \nQ 17.828125 56 27.875 56 \nQ 33.9375 56 38.28125 53.609375 \nQ 42.625 51.21875 45.40625 46.390625 \nL 45.40625 54.6875 \nL 54.390625 54.6875 \nz\n\" id=\"DejaVuSans-103\"/>\n      <path d=\"M 18.109375 8.203125 \nL 18.109375 -20.796875 \nL 9.078125 -20.796875 \nL 9.078125 54.6875 \nL 18.109375 54.6875 \nL 18.109375 46.390625 \nQ 20.953125 51.265625 25.265625 53.625 \nQ 29.59375 56 35.59375 56 \nQ 45.5625 56 51.78125 48.09375 \nQ 58.015625 40.1875 58.015625 27.296875 \nQ 58.015625 14.40625 51.78125 6.484375 \nQ 45.5625 -1.421875 35.59375 -1.421875 \nQ 29.59375 -1.421875 25.265625 0.953125 \nQ 20.953125 3.328125 18.109375 8.203125 \nz\nM 48.6875 27.296875 \nQ 48.6875 37.203125 44.609375 42.84375 \nQ 40.53125 48.484375 33.40625 48.484375 \nQ 26.265625 48.484375 22.1875 42.84375 \nQ 18.109375 37.203125 18.109375 27.296875 \nQ 18.109375 17.390625 22.1875 11.75 \nQ 26.265625 6.109375 33.40625 6.109375 \nQ 40.53125 6.109375 44.609375 11.75 \nQ 48.6875 17.390625 48.6875 27.296875 \nz\n\" id=\"DejaVuSans-112\"/>\n      <path d=\"M 8.5 21.578125 \nL 8.5 54.6875 \nL 17.484375 54.6875 \nL 17.484375 21.921875 \nQ 17.484375 14.15625 20.5 10.265625 \nQ 23.53125 6.390625 29.59375 6.390625 \nQ 36.859375 6.390625 41.078125 11.03125 \nQ 45.3125 15.671875 45.3125 23.6875 \nL 45.3125 54.6875 \nL 54.296875 54.6875 \nL 54.296875 0 \nL 45.3125 0 \nL 45.3125 8.40625 \nQ 42.046875 3.421875 37.71875 1 \nQ 33.40625 -1.421875 27.6875 -1.421875 \nQ 18.265625 -1.421875 13.375 4.4375 \nQ 8.5 10.296875 8.5 21.578125 \nz\nM 31.109375 56 \nz\n\" id=\"DejaVuSans-117\"/>\n      <path d=\"M 44.28125 53.078125 \nL 44.28125 44.578125 \nQ 40.484375 46.53125 36.375 47.5 \nQ 32.28125 48.484375 27.875 48.484375 \nQ 21.1875 48.484375 17.84375 46.4375 \nQ 14.5 44.390625 14.5 40.28125 \nQ 14.5 37.15625 16.890625 35.375 \nQ 19.28125 33.59375 26.515625 31.984375 \nL 29.59375 31.296875 \nQ 39.15625 29.25 43.1875 25.515625 \nQ 47.21875 21.78125 47.21875 15.09375 \nQ 47.21875 7.46875 41.1875 3.015625 \nQ 35.15625 -1.421875 24.609375 -1.421875 \nQ 20.21875 -1.421875 15.453125 -0.5625 \nQ 10.6875 0.296875 5.421875 2 \nL 5.421875 11.28125 \nQ 10.40625 8.6875 15.234375 7.390625 \nQ 20.0625 6.109375 24.8125 6.109375 \nQ 31.15625 6.109375 34.5625 8.28125 \nQ 37.984375 10.453125 37.984375 14.40625 \nQ 37.984375 18.0625 35.515625 20.015625 \nQ 33.0625 21.96875 24.703125 23.78125 \nL 21.578125 24.515625 \nQ 13.234375 26.265625 9.515625 29.90625 \nQ 5.8125 33.546875 5.8125 39.890625 \nQ 5.8125 47.609375 11.28125 51.796875 \nQ 16.75 56 26.8125 56 \nQ 31.78125 56 36.171875 55.265625 \nQ 40.578125 54.546875 44.28125 53.078125 \nz\n\" id=\"DejaVuSans-115\"/>\n     </defs>\n     <g transform=\"translate(41.889844 149.759781)scale(0.1 -0.1)\">\n      <use xlink:href=\"#DejaVuSans-83\"/>\n      <use x=\"63.476562\" xlink:href=\"#DejaVuSans-111\"/>\n      <use x=\"124.658203\" xlink:href=\"#DejaVuSans-114\"/>\n      <use x=\"165.771484\" xlink:href=\"#DejaVuSans-116\"/>\n      <use x=\"204.980469\" xlink:href=\"#DejaVuSans-101\"/>\n      <use x=\"266.503906\" xlink:href=\"#DejaVuSans-100\"/>\n      <use x=\"329.980469\" xlink:href=\"#DejaVuSans-32\"/>\n      <use x=\"361.767578\" xlink:href=\"#DejaVuSans-116\"/>\n      <use x=\"400.976562\" xlink:href=\"#DejaVuSans-114\"/>\n      <use x=\"442.089844\" xlink:href=\"#DejaVuSans-97\"/>\n      <use x=\"503.369141\" xlink:href=\"#DejaVuSans-105\"/>\n      <use x=\"531.152344\" xlink:href=\"#DejaVuSans-110\"/>\n      <use x=\"594.53125\" xlink:href=\"#DejaVuSans-105\"/>\n      <use x=\"622.314453\" xlink:href=\"#DejaVuSans-110\"/>\n      <use x=\"685.693359\" xlink:href=\"#DejaVuSans-103\"/>\n      <use x=\"749.169922\" xlink:href=\"#DejaVuSans-32\"/>\n      <use x=\"780.957031\" xlink:href=\"#DejaVuSans-105\"/>\n      <use x=\"808.740234\" xlink:href=\"#DejaVuSans-110\"/>\n      <use x=\"872.119141\" xlink:href=\"#DejaVuSans-112\"/>\n      <use x=\"935.595703\" xlink:href=\"#DejaVuSans-117\"/>\n      <use x=\"998.974609\" xlink:href=\"#DejaVuSans-116\"/>\n      <use x=\"1038.183594\" xlink:href=\"#DejaVuSans-115\"/>\n     </g>\n    </g>\n   </g>\n   <g id=\"matplotlib.axis_2\">\n    <g id=\"ytick_1\">\n     <g id=\"line2d_4\">\n      <defs>\n       <path d=\"M 0 0 \nL -3.5 0 \n\" id=\"m2cfc757f6a\" style=\"stroke:#000000;stroke-width:0.8;\"/>\n      </defs>\n      <g>\n       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"40.603125\" xlink:href=\"#m2cfc757f6a\" y=\"10.999219\"/>\n      </g>\n     </g>\n     <g id=\"text_5\">\n      <!-- 0 -->\n      <g transform=\"translate(27.240625 14.798437)scale(0.1 -0.1)\">\n       <use xlink:href=\"#DejaVuSans-48\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"ytick_2\">\n     <g id=\"line2d_5\">\n      <g>\n       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"40.603125\" xlink:href=\"#m2cfc757f6a\" y=\"33.319219\"/>\n      </g>\n     </g>\n     <g id=\"text_6\">\n      <!-- 10 -->\n      <defs>\n       <path d=\"M 12.40625 8.296875 \nL 28.515625 8.296875 \nL 28.515625 63.921875 \nL 10.984375 60.40625 \nL 10.984375 69.390625 \nL 28.421875 72.90625 \nL 38.28125 72.90625 \nL 38.28125 8.296875 \nL 54.390625 8.296875 \nL 54.390625 0 \nL 12.40625 0 \nz\n\" id=\"DejaVuSans-49\"/>\n      </defs>\n      <g transform=\"translate(20.878125 37.118437)scale(0.1 -0.1)\">\n       <use xlink:href=\"#DejaVuSans-49\"/>\n       <use x=\"63.623047\" xlink:href=\"#DejaVuSans-48\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"ytick_3\">\n     <g id=\"line2d_6\">\n      <g>\n       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"40.603125\" xlink:href=\"#m2cfc757f6a\" y=\"55.639219\"/>\n      </g>\n     </g>\n     <g id=\"text_7\">\n      <!-- 20 -->\n      <g transform=\"translate(20.878125 59.438437)scale(0.1 -0.1)\">\n       <use xlink:href=\"#DejaVuSans-50\"/>\n       <use x=\"63.623047\" xlink:href=\"#DejaVuSans-48\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"ytick_4\">\n     <g id=\"line2d_7\">\n      <g>\n       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"40.603125\" xlink:href=\"#m2cfc757f6a\" y=\"77.959219\"/>\n      </g>\n     </g>\n     <g id=\"text_8\">\n      <!-- 30 -->\n      <defs>\n       <path d=\"M 40.578125 39.3125 \nQ 47.65625 37.796875 51.625 33 \nQ 55.609375 28.21875 55.609375 21.1875 \nQ 55.609375 10.40625 48.1875 4.484375 \nQ 40.765625 -1.421875 27.09375 -1.421875 \nQ 22.515625 -1.421875 17.65625 -0.515625 \nQ 12.796875 0.390625 7.625 2.203125 \nL 7.625 11.71875 \nQ 11.71875 9.328125 16.59375 8.109375 \nQ 21.484375 6.890625 26.8125 6.890625 \nQ 36.078125 6.890625 40.9375 10.546875 \nQ 45.796875 14.203125 45.796875 21.1875 \nQ 45.796875 27.640625 41.28125 31.265625 \nQ 36.765625 34.90625 28.71875 34.90625 \nL 20.21875 34.90625 \nL 20.21875 43.015625 \nL 29.109375 43.015625 \nQ 36.375 43.015625 40.234375 45.921875 \nQ 44.09375 48.828125 44.09375 54.296875 \nQ 44.09375 59.90625 40.109375 62.90625 \nQ 36.140625 65.921875 28.71875 65.921875 \nQ 24.65625 65.921875 20.015625 65.03125 \nQ 15.375 64.15625 9.8125 62.3125 \nL 9.8125 71.09375 \nQ 15.4375 72.65625 20.34375 73.4375 \nQ 25.25 74.21875 29.59375 74.21875 \nQ 40.828125 74.21875 47.359375 69.109375 \nQ 53.90625 64.015625 53.90625 55.328125 \nQ 53.90625 49.265625 50.4375 45.09375 \nQ 46.96875 40.921875 40.578125 39.3125 \nz\n\" id=\"DejaVuSans-51\"/>\n      </defs>\n      <g transform=\"translate(20.878125 81.758437)scale(0.1 -0.1)\">\n       <use xlink:href=\"#DejaVuSans-51\"/>\n       <use x=\"63.623047\" xlink:href=\"#DejaVuSans-48\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"ytick_5\">\n     <g id=\"line2d_8\">\n      <g>\n       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"40.603125\" xlink:href=\"#m2cfc757f6a\" y=\"100.279219\"/>\n      </g>\n     </g>\n     <g id=\"text_9\">\n      <!-- 40 -->\n      <g transform=\"translate(20.878125 104.078437)scale(0.1 -0.1)\">\n       <use xlink:href=\"#DejaVuSans-52\"/>\n       <use x=\"63.623047\" xlink:href=\"#DejaVuSans-48\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"text_10\">\n     <!-- Sorted testing inputs -->\n     <g transform=\"translate(14.798438 118.160562)rotate(-90)scale(0.1 -0.1)\">\n      <use xlink:href=\"#DejaVuSans-83\"/>\n      <use x=\"63.476562\" xlink:href=\"#DejaVuSans-111\"/>\n      <use x=\"124.658203\" xlink:href=\"#DejaVuSans-114\"/>\n      <use x=\"165.771484\" xlink:href=\"#DejaVuSans-116\"/>\n      <use x=\"204.980469\" xlink:href=\"#DejaVuSans-101\"/>\n      <use x=\"266.503906\" xlink:href=\"#DejaVuSans-100\"/>\n      <use x=\"329.980469\" xlink:href=\"#DejaVuSans-32\"/>\n      <use x=\"361.767578\" xlink:href=\"#DejaVuSans-116\"/>\n      <use x=\"400.976562\" xlink:href=\"#DejaVuSans-101\"/>\n      <use x=\"462.5\" xlink:href=\"#DejaVuSans-115\"/>\n      <use x=\"514.599609\" xlink:href=\"#DejaVuSans-116\"/>\n      <use x=\"553.808594\" xlink:href=\"#DejaVuSans-105\"/>\n      <use x=\"581.591797\" xlink:href=\"#DejaVuSans-110\"/>\n      <use x=\"644.970703\" xlink:href=\"#DejaVuSans-103\"/>\n      <use x=\"708.447266\" xlink:href=\"#DejaVuSans-32\"/>\n      <use x=\"740.234375\" xlink:href=\"#DejaVuSans-105\"/>\n      <use x=\"768.017578\" xlink:href=\"#DejaVuSans-110\"/>\n      <use x=\"831.396484\" xlink:href=\"#DejaVuSans-112\"/>\n      <use x=\"894.873047\" xlink:href=\"#DejaVuSans-117\"/>\n      <use x=\"958.251953\" xlink:href=\"#DejaVuSans-116\"/>\n      <use x=\"997.460938\" xlink:href=\"#DejaVuSans-115\"/>\n     </g>\n    </g>\n   </g>\n   <g id=\"patch_3\">\n    <path d=\"M 40.603125 121.483219 \nL 40.603125 9.883219 \n\" style=\"fill:none;stroke:#000000;stroke-linecap:square;stroke-linejoin:miter;stroke-width:0.8;\"/>\n   </g>\n   <g id=\"patch_4\">\n    <path d=\"M 152.203125 121.483219 \nL 152.203125 9.883219 \n\" style=\"fill:none;stroke:#000000;stroke-linecap:square;stroke-linejoin:miter;stroke-width:0.8;\"/>\n   </g>\n   <g id=\"patch_5\">\n    <path d=\"M 40.603125 121.483219 \nL 152.203125 121.483219 \n\" style=\"fill:none;stroke:#000000;stroke-linecap:square;stroke-linejoin:miter;stroke-width:0.8;\"/>\n   </g>\n   <g id=\"patch_6\">\n    <path d=\"M 40.603125 9.883219 \nL 152.203125 9.883219 \n\" style=\"fill:none;stroke:#000000;stroke-linecap:square;stroke-linejoin:miter;stroke-width:0.8;\"/>\n   </g>\n  </g>\n  <g id=\"axes_2\">\n   <g id=\"patch_7\">\n    <path clip-path=\"url(#pde0c1e167f)\" d=\"M 159.178125 106.453219 \nL 159.178125 106.134703 \nL 159.178125 25.231734 \nL 159.178125 24.913219 \nL 163.255125 24.913219 \nL 163.255125 25.231734 \nL 163.255125 106.134703 \nL 163.255125 106.453219 \nz\n\" style=\"fill:#ffffff;stroke:#ffffff;stroke-linejoin:miter;stroke-width:0.01;\"/>\n   </g>\n   <image height=\"81\" id=\"image948b82885c\" transform=\"scale(1 -1)translate(0 -81)\" width=\"4\" x=\"159\" xlink:href=\"data:image/png;base64,\niVBORw0KGgoAAAANSUhEUgAAAAQAAABRCAYAAAD1sgc6AAAABHNCSVQICAgIfAhkiAAAAJxJREFUOI2dkjsOwlAQAx8S9z8pFRXslxbGkSyRcjS2N1Fu+3zs+XruZ/oADAGM1UiZiC9VUAnQWNl8G8N3iLHNSEkk3IpGvEEgdwRn/dv6FQ9SPiF/hz9K2SHGBkFxNuUOBybHGFpq7+hCaff+gmoaBUMiKaUExUjblRpGlrMERYDVC0MjRwzXIXcET78wUBpiELyklCB4qdzB0g/+a8q1SIPaUQAAAABJRU5ErkJggg==\" y=\"-25\"/>\n   <g id=\"matplotlib.axis_3\"/>\n   <g id=\"matplotlib.axis_4\">\n    <g id=\"ytick_6\">\n     <g id=\"line2d_9\">\n      <defs>\n       <path d=\"M 0 0 \nL 3.5 0 \n\" id=\"m8adcf2b4c6\" style=\"stroke:#000000;stroke-width:0.8;\"/>\n      </defs>\n      <g>\n       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"163.255125\" xlink:href=\"#m8adcf2b4c6\" y=\"85.878422\"/>\n      </g>\n     </g>\n     <g id=\"text_11\">\n      <!-- 0.025 -->\n      <defs>\n       <path d=\"M 10.6875 12.40625 \nL 21 12.40625 \nL 21 0 \nL 10.6875 0 \nz\n\" id=\"DejaVuSans-46\"/>\n       <path d=\"M 10.796875 72.90625 \nL 49.515625 72.90625 \nL 49.515625 64.59375 \nL 19.828125 64.59375 \nL 19.828125 46.734375 \nQ 21.96875 47.46875 24.109375 47.828125 \nQ 26.265625 48.1875 28.421875 48.1875 \nQ 40.625 48.1875 47.75 41.5 \nQ 54.890625 34.8125 54.890625 23.390625 \nQ 54.890625 11.625 47.5625 5.09375 \nQ 40.234375 -1.421875 26.90625 -1.421875 \nQ 22.3125 -1.421875 17.546875 -0.640625 \nQ 12.796875 0.140625 7.71875 1.703125 \nL 7.71875 11.625 \nQ 12.109375 9.234375 16.796875 8.0625 \nQ 21.484375 6.890625 26.703125 6.890625 \nQ 35.15625 6.890625 40.078125 11.328125 \nQ 45.015625 15.765625 45.015625 23.390625 \nQ 45.015625 31 40.078125 35.4375 \nQ 35.15625 39.890625 26.703125 39.890625 \nQ 22.75 39.890625 18.8125 39.015625 \nQ 14.890625 38.140625 10.796875 36.28125 \nz\n\" id=\"DejaVuSans-53\"/>\n      </defs>\n      <g transform=\"translate(170.255125 89.677641)scale(0.1 -0.1)\">\n       <use xlink:href=\"#DejaVuSans-48\"/>\n       <use x=\"63.623047\" xlink:href=\"#DejaVuSans-46\"/>\n       <use x=\"95.410156\" xlink:href=\"#DejaVuSans-48\"/>\n       <use x=\"159.033203\" xlink:href=\"#DejaVuSans-50\"/>\n       <use x=\"222.65625\" xlink:href=\"#DejaVuSans-53\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"ytick_7\">\n     <g id=\"line2d_10\">\n      <g>\n       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"163.255125\" xlink:href=\"#m8adcf2b4c6\" y=\"65.303187\"/>\n      </g>\n     </g>\n     <g id=\"text_12\">\n      <!-- 0.050 -->\n      <g transform=\"translate(170.255125 69.102406)scale(0.1 -0.1)\">\n       <use xlink:href=\"#DejaVuSans-48\"/>\n       <use x=\"63.623047\" xlink:href=\"#DejaVuSans-46\"/>\n       <use x=\"95.410156\" xlink:href=\"#DejaVuSans-48\"/>\n       <use x=\"159.033203\" xlink:href=\"#DejaVuSans-53\"/>\n       <use x=\"222.65625\" xlink:href=\"#DejaVuSans-48\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"ytick_8\">\n     <g id=\"line2d_11\">\n      <g>\n       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"163.255125\" xlink:href=\"#m8adcf2b4c6\" y=\"44.727952\"/>\n      </g>\n     </g>\n     <g id=\"text_13\">\n      <!-- 0.075 -->\n      <defs>\n       <path d=\"M 8.203125 72.90625 \nL 55.078125 72.90625 \nL 55.078125 68.703125 \nL 28.609375 0 \nL 18.3125 0 \nL 43.21875 64.59375 \nL 8.203125 64.59375 \nz\n\" id=\"DejaVuSans-55\"/>\n      </defs>\n      <g transform=\"translate(170.255125 48.527171)scale(0.1 -0.1)\">\n       <use xlink:href=\"#DejaVuSans-48\"/>\n       <use x=\"63.623047\" xlink:href=\"#DejaVuSans-46\"/>\n       <use x=\"95.410156\" xlink:href=\"#DejaVuSans-48\"/>\n       <use x=\"159.033203\" xlink:href=\"#DejaVuSans-55\"/>\n       <use x=\"222.65625\" xlink:href=\"#DejaVuSans-53\"/>\n      </g>\n     </g>\n    </g>\n   </g>\n   <g id=\"patch_8\">\n    <path d=\"M 159.178125 106.453219 \nL 159.178125 106.134703 \nL 159.178125 25.231734 \nL 159.178125 24.913219 \nL 163.255125 24.913219 \nL 163.255125 25.231734 \nL 163.255125 106.134703 \nL 163.255125 106.453219 \nz\n\" style=\"fill:none;stroke:#000000;stroke-linejoin:miter;stroke-width:0.8;\"/>\n   </g>\n  </g>\n </g>\n <defs>\n  <clipPath id=\"p632e6ce747\">\n   <rect height=\"111.6\" width=\"111.6\" x=\"40.603125\" y=\"9.883219\"/>\n  </clipPath>\n  <clipPath id=\"pde0c1e167f\">\n   <rect height=\"81.54\" width=\"4.077\" x=\"159.178125\" y=\"24.913219\"/>\n  </clipPath>\n </defs>\n</svg>\n",
            "text/plain": [
              "<Figure size 180x180 with 2 Axes>"
            ]
          },
          "metadata": {
            "needs_background": "light"
          },
          "output_type": "display_data"
        }
      ],
      "source": [
        "show_heatmaps(attention_weights.unsqueeze(0).unsqueeze(0),xlabel='Sorted training inputs',ylabel='Sorted testing inputs')"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "TOJQBe9p3uPw"
      },
      "source": [
        "###带参数注意力汇聚\n",
        "\n",
        "\\begin{equation} f(x)=Σ_{i=1}^{n}softmax(-\\frac{1}{2}((x-x_i)\\omega)^2)y_i \\end{equation}\n",
        "\n",
        "*   批量矩阵乘法\n",
        "\n",
        "\\begin{equation} (n,a,b),(n,b,c) \\to (n,a,c) \\end{equation}\n",
        "\n"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/"
        },
        "id": "0SHYywlG3XRb",
        "outputId": "7fd3eba5-338a-44f9-e2ad-53352771b42c"
      },
      "outputs": [
        {
          "data": {
            "text/plain": [
              "torch.Size([2, 1, 6])"
            ]
          },
          "execution_count": 29,
          "metadata": {},
          "output_type": "execute_result"
        }
      ],
      "source": [
        "X = torch.ones((2,1,4))\n",
        "Y = torch.ones((2,4,6))\n",
        "torch.bmm(X,Y).shape"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "AqYuAVbGC2OJ"
      },
      "source": [
        "计算加权平均值"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/"
        },
        "id": "fCYBwGT54IOq",
        "outputId": "09293569-4798-4595-9f6c-9d2881dd0aa2"
      },
      "outputs": [
        {
          "data": {
            "text/plain": [
              "tensor([[[ 4.5000]],\n",
              "\n",
              "        [[14.5000]]])"
            ]
          },
          "execution_count": 31,
          "metadata": {},
          "output_type": "execute_result"
        }
      ],
      "source": [
        "weights = torch.ones((2,10)) * 0.1\n",
        "values = torch.arange(20.0).reshape((2,10))\n",
        "torch.bmm(weights.unsqueeze(1),values.unsqueeze(-1))"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "JyZSOiee4PSu"
      },
      "source": [
        "*   定义模型"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "id": "Kr9S9BPm5K2U"
      },
      "outputs": [],
      "source": [
        "class NWKernelRegression(nn.Module):\n",
        "    def __init__(self,**kwargs):\n",
        "        super().__init__(**kwargs)\n",
        "        self.w = nn.Parameter(torch.rand((1,),requires_grad=True))\n",
        "\n",
        "    def forward(self,queries,keys,values):\n",
        "        # queries和attention_weights的形状为(查询个数，\"键——值\"对个数)\n",
        "        queries = queries.repeat_interleave(keys.shape[1]).reshape((-1,keys.shape[1]))\n",
        "        self.attention_weights = nn.functional.softmax(-((queries - keys) * self.w)**2 /2,dim=1)\n",
        "        # values的形状为（查询个数，\"键——值\"对个数）\n",
        "        return torch.bmm(self.attention_weights.unsqueeze(1),values.unsqueeze(-1)).reshape(-1)"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "xgS-g5fk63_t"
      },
      "source": [
        "*   训练"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "id": "XQ0l0wPO6_BM"
      },
      "outputs": [],
      "source": [
        "# X_title的形状：（n_train，n_train），每一行都包含着相同的训练输入\n",
        "X_tile = x_train.repeat((n_train,1))\n",
        "# Y_title的形状：（n_train，n_train），每一行都包含着相同的训练输入\n",
        "Y_tile = y_train.repeat((n_train,1))\n",
        "# keys的形状：（'n_train'，'n_train'-1）\n",
        "keys = X_tile[(1 - torch.eye(n_train)).type(torch.bool)].reshape((n_train,-1))\n",
        "# values的形状：（'n_train'，'n_train'-1）\n",
        "values = Y_tile[(1 - torch.eye(n_train)).type(torch.bool)].reshape((n_train,-1))"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "PyHIJdEqERRI"
      },
      "source": [
        "使用平方损失函数和随机梯度下降"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 262
        },
        "id": "SrL-oq1D79Ao",
        "outputId": "c5668575-5c96-480b-9056-7020e7aa298a"
      },
      "outputs": [
        {
          "data": {
            "image/svg+xml": "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"no\"?>\n<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\"\n  \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">\n<!-- Created with matplotlib (https://matplotlib.org/) -->\n<svg height=\"180.65625pt\" version=\"1.1\" viewBox=\"0 0 246.284375 180.65625\" width=\"246.284375pt\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n <defs>\n  <style type=\"text/css\">\n*{stroke-linecap:butt;stroke-linejoin:round;}\n  </style>\n </defs>\n <g id=\"figure_1\">\n  <g id=\"patch_1\">\n   <path d=\"M 0 180.65625 \nL 246.284375 180.65625 \nL 246.284375 0 \nL 0 0 \nz\n\" style=\"fill:none;\"/>\n  </g>\n  <g id=\"axes_1\">\n   <g id=\"patch_2\">\n    <path d=\"M 40.603125 143.1 \nL 235.903125 143.1 \nL 235.903125 7.2 \nL 40.603125 7.2 \nz\n\" style=\"fill:#ffffff;\"/>\n   </g>\n   <g id=\"matplotlib.axis_1\">\n    <g id=\"xtick_1\">\n     <g id=\"line2d_1\">\n      <path clip-path=\"url(#pe177d995d6)\" d=\"M 40.603125 143.1 \nL 40.603125 7.2 \n\" style=\"fill:none;stroke:#b0b0b0;stroke-linecap:square;stroke-width:0.8;\"/>\n     </g>\n     <g id=\"line2d_2\">\n      <defs>\n       <path d=\"M 0 0 \nL 0 3.5 \n\" id=\"m51529eba11\" style=\"stroke:#000000;stroke-width:0.8;\"/>\n      </defs>\n      <g>\n       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"40.603125\" xlink:href=\"#m51529eba11\" y=\"143.1\"/>\n      </g>\n     </g>\n     <g id=\"text_1\">\n      <!-- 1 -->\n      <defs>\n       <path d=\"M 12.40625 8.296875 \nL 28.515625 8.296875 \nL 28.515625 63.921875 \nL 10.984375 60.40625 \nL 10.984375 69.390625 \nL 28.421875 72.90625 \nL 38.28125 72.90625 \nL 38.28125 8.296875 \nL 54.390625 8.296875 \nL 54.390625 0 \nL 12.40625 0 \nz\n\" id=\"DejaVuSans-49\"/>\n      </defs>\n      <g transform=\"translate(37.421875 157.698438)scale(0.1 -0.1)\">\n       <use xlink:href=\"#DejaVuSans-49\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"xtick_2\">\n     <g id=\"line2d_3\">\n      <path clip-path=\"url(#pe177d995d6)\" d=\"M 89.428125 143.1 \nL 89.428125 7.2 \n\" style=\"fill:none;stroke:#b0b0b0;stroke-linecap:square;stroke-width:0.8;\"/>\n     </g>\n     <g id=\"line2d_4\">\n      <g>\n       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"89.428125\" xlink:href=\"#m51529eba11\" y=\"143.1\"/>\n      </g>\n     </g>\n     <g id=\"text_2\">\n      <!-- 2 -->\n      <defs>\n       <path d=\"M 19.1875 8.296875 \nL 53.609375 8.296875 \nL 53.609375 0 \nL 7.328125 0 \nL 7.328125 8.296875 \nQ 12.9375 14.109375 22.625 23.890625 \nQ 32.328125 33.6875 34.8125 36.53125 \nQ 39.546875 41.84375 41.421875 45.53125 \nQ 43.3125 49.21875 43.3125 52.78125 \nQ 43.3125 58.59375 39.234375 62.25 \nQ 35.15625 65.921875 28.609375 65.921875 \nQ 23.96875 65.921875 18.8125 64.3125 \nQ 13.671875 62.703125 7.8125 59.421875 \nL 7.8125 69.390625 \nQ 13.765625 71.78125 18.9375 73 \nQ 24.125 74.21875 28.421875 74.21875 \nQ 39.75 74.21875 46.484375 68.546875 \nQ 53.21875 62.890625 53.21875 53.421875 \nQ 53.21875 48.921875 51.53125 44.890625 \nQ 49.859375 40.875 45.40625 35.40625 \nQ 44.1875 33.984375 37.640625 27.21875 \nQ 31.109375 20.453125 19.1875 8.296875 \nz\n\" id=\"DejaVuSans-50\"/>\n      </defs>\n      <g transform=\"translate(86.246875 157.698438)scale(0.1 -0.1)\">\n       <use xlink:href=\"#DejaVuSans-50\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"xtick_3\">\n     <g id=\"line2d_5\">\n      <path clip-path=\"url(#pe177d995d6)\" d=\"M 138.253125 143.1 \nL 138.253125 7.2 \n\" style=\"fill:none;stroke:#b0b0b0;stroke-linecap:square;stroke-width:0.8;\"/>\n     </g>\n     <g id=\"line2d_6\">\n      <g>\n       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"138.253125\" xlink:href=\"#m51529eba11\" y=\"143.1\"/>\n      </g>\n     </g>\n     <g id=\"text_3\">\n      <!-- 3 -->\n      <defs>\n       <path d=\"M 40.578125 39.3125 \nQ 47.65625 37.796875 51.625 33 \nQ 55.609375 28.21875 55.609375 21.1875 \nQ 55.609375 10.40625 48.1875 4.484375 \nQ 40.765625 -1.421875 27.09375 -1.421875 \nQ 22.515625 -1.421875 17.65625 -0.515625 \nQ 12.796875 0.390625 7.625 2.203125 \nL 7.625 11.71875 \nQ 11.71875 9.328125 16.59375 8.109375 \nQ 21.484375 6.890625 26.8125 6.890625 \nQ 36.078125 6.890625 40.9375 10.546875 \nQ 45.796875 14.203125 45.796875 21.1875 \nQ 45.796875 27.640625 41.28125 31.265625 \nQ 36.765625 34.90625 28.71875 34.90625 \nL 20.21875 34.90625 \nL 20.21875 43.015625 \nL 29.109375 43.015625 \nQ 36.375 43.015625 40.234375 45.921875 \nQ 44.09375 48.828125 44.09375 54.296875 \nQ 44.09375 59.90625 40.109375 62.90625 \nQ 36.140625 65.921875 28.71875 65.921875 \nQ 24.65625 65.921875 20.015625 65.03125 \nQ 15.375 64.15625 9.8125 62.3125 \nL 9.8125 71.09375 \nQ 15.4375 72.65625 20.34375 73.4375 \nQ 25.25 74.21875 29.59375 74.21875 \nQ 40.828125 74.21875 47.359375 69.109375 \nQ 53.90625 64.015625 53.90625 55.328125 \nQ 53.90625 49.265625 50.4375 45.09375 \nQ 46.96875 40.921875 40.578125 39.3125 \nz\n\" id=\"DejaVuSans-51\"/>\n      </defs>\n      <g transform=\"translate(135.071875 157.698438)scale(0.1 -0.1)\">\n       <use xlink:href=\"#DejaVuSans-51\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"xtick_4\">\n     <g id=\"line2d_7\">\n      <path clip-path=\"url(#pe177d995d6)\" d=\"M 187.078125 143.1 \nL 187.078125 7.2 \n\" style=\"fill:none;stroke:#b0b0b0;stroke-linecap:square;stroke-width:0.8;\"/>\n     </g>\n     <g id=\"line2d_8\">\n      <g>\n       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"187.078125\" xlink:href=\"#m51529eba11\" y=\"143.1\"/>\n      </g>\n     </g>\n     <g id=\"text_4\">\n      <!-- 4 -->\n      <defs>\n       <path d=\"M 37.796875 64.3125 \nL 12.890625 25.390625 \nL 37.796875 25.390625 \nz\nM 35.203125 72.90625 \nL 47.609375 72.90625 \nL 47.609375 25.390625 \nL 58.015625 25.390625 \nL 58.015625 17.1875 \nL 47.609375 17.1875 \nL 47.609375 0 \nL 37.796875 0 \nL 37.796875 17.1875 \nL 4.890625 17.1875 \nL 4.890625 26.703125 \nz\n\" id=\"DejaVuSans-52\"/>\n      </defs>\n      <g transform=\"translate(183.896875 157.698438)scale(0.1 -0.1)\">\n       <use xlink:href=\"#DejaVuSans-52\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"xtick_5\">\n     <g id=\"line2d_9\">\n      <path clip-path=\"url(#pe177d995d6)\" d=\"M 235.903125 143.1 \nL 235.903125 7.2 \n\" style=\"fill:none;stroke:#b0b0b0;stroke-linecap:square;stroke-width:0.8;\"/>\n     </g>\n     <g id=\"line2d_10\">\n      <g>\n       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"235.903125\" xlink:href=\"#m51529eba11\" y=\"143.1\"/>\n      </g>\n     </g>\n     <g id=\"text_5\">\n      <!-- 5 -->\n      <defs>\n       <path d=\"M 10.796875 72.90625 \nL 49.515625 72.90625 \nL 49.515625 64.59375 \nL 19.828125 64.59375 \nL 19.828125 46.734375 \nQ 21.96875 47.46875 24.109375 47.828125 \nQ 26.265625 48.1875 28.421875 48.1875 \nQ 40.625 48.1875 47.75 41.5 \nQ 54.890625 34.8125 54.890625 23.390625 \nQ 54.890625 11.625 47.5625 5.09375 \nQ 40.234375 -1.421875 26.90625 -1.421875 \nQ 22.3125 -1.421875 17.546875 -0.640625 \nQ 12.796875 0.140625 7.71875 1.703125 \nL 7.71875 11.625 \nQ 12.109375 9.234375 16.796875 8.0625 \nQ 21.484375 6.890625 26.703125 6.890625 \nQ 35.15625 6.890625 40.078125 11.328125 \nQ 45.015625 15.765625 45.015625 23.390625 \nQ 45.015625 31 40.078125 35.4375 \nQ 35.15625 39.890625 26.703125 39.890625 \nQ 22.75 39.890625 18.8125 39.015625 \nQ 14.890625 38.140625 10.796875 36.28125 \nz\n\" id=\"DejaVuSans-53\"/>\n      </defs>\n      <g transform=\"translate(232.721875 157.698438)scale(0.1 -0.1)\">\n       <use xlink:href=\"#DejaVuSans-53\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"text_6\">\n     <!-- epoch -->\n     <defs>\n      <path d=\"M 56.203125 29.59375 \nL 56.203125 25.203125 \nL 14.890625 25.203125 \nQ 15.484375 15.921875 20.484375 11.0625 \nQ 25.484375 6.203125 34.421875 6.203125 \nQ 39.59375 6.203125 44.453125 7.46875 \nQ 49.3125 8.734375 54.109375 11.28125 \nL 54.109375 2.78125 \nQ 49.265625 0.734375 44.1875 -0.34375 \nQ 39.109375 -1.421875 33.890625 -1.421875 \nQ 20.796875 -1.421875 13.15625 6.1875 \nQ 5.515625 13.8125 5.515625 26.8125 \nQ 5.515625 40.234375 12.765625 48.109375 \nQ 20.015625 56 32.328125 56 \nQ 43.359375 56 49.78125 48.890625 \nQ 56.203125 41.796875 56.203125 29.59375 \nz\nM 47.21875 32.234375 \nQ 47.125 39.59375 43.09375 43.984375 \nQ 39.0625 48.390625 32.421875 48.390625 \nQ 24.90625 48.390625 20.390625 44.140625 \nQ 15.875 39.890625 15.1875 32.171875 \nz\n\" id=\"DejaVuSans-101\"/>\n      <path d=\"M 18.109375 8.203125 \nL 18.109375 -20.796875 \nL 9.078125 -20.796875 \nL 9.078125 54.6875 \nL 18.109375 54.6875 \nL 18.109375 46.390625 \nQ 20.953125 51.265625 25.265625 53.625 \nQ 29.59375 56 35.59375 56 \nQ 45.5625 56 51.78125 48.09375 \nQ 58.015625 40.1875 58.015625 27.296875 \nQ 58.015625 14.40625 51.78125 6.484375 \nQ 45.5625 -1.421875 35.59375 -1.421875 \nQ 29.59375 -1.421875 25.265625 0.953125 \nQ 20.953125 3.328125 18.109375 8.203125 \nz\nM 48.6875 27.296875 \nQ 48.6875 37.203125 44.609375 42.84375 \nQ 40.53125 48.484375 33.40625 48.484375 \nQ 26.265625 48.484375 22.1875 42.84375 \nQ 18.109375 37.203125 18.109375 27.296875 \nQ 18.109375 17.390625 22.1875 11.75 \nQ 26.265625 6.109375 33.40625 6.109375 \nQ 40.53125 6.109375 44.609375 11.75 \nQ 48.6875 17.390625 48.6875 27.296875 \nz\n\" id=\"DejaVuSans-112\"/>\n      <path d=\"M 30.609375 48.390625 \nQ 23.390625 48.390625 19.1875 42.75 \nQ 14.984375 37.109375 14.984375 27.296875 \nQ 14.984375 17.484375 19.15625 11.84375 \nQ 23.34375 6.203125 30.609375 6.203125 \nQ 37.796875 6.203125 41.984375 11.859375 \nQ 46.1875 17.53125 46.1875 27.296875 \nQ 46.1875 37.015625 41.984375 42.703125 \nQ 37.796875 48.390625 30.609375 48.390625 \nz\nM 30.609375 56 \nQ 42.328125 56 49.015625 48.375 \nQ 55.71875 40.765625 55.71875 27.296875 \nQ 55.71875 13.875 49.015625 6.21875 \nQ 42.328125 -1.421875 30.609375 -1.421875 \nQ 18.84375 -1.421875 12.171875 6.21875 \nQ 5.515625 13.875 5.515625 27.296875 \nQ 5.515625 40.765625 12.171875 48.375 \nQ 18.84375 56 30.609375 56 \nz\n\" id=\"DejaVuSans-111\"/>\n      <path d=\"M 48.78125 52.59375 \nL 48.78125 44.1875 \nQ 44.96875 46.296875 41.140625 47.34375 \nQ 37.3125 48.390625 33.40625 48.390625 \nQ 24.65625 48.390625 19.8125 42.84375 \nQ 14.984375 37.3125 14.984375 27.296875 \nQ 14.984375 17.28125 19.8125 11.734375 \nQ 24.65625 6.203125 33.40625 6.203125 \nQ 37.3125 6.203125 41.140625 7.25 \nQ 44.96875 8.296875 48.78125 10.40625 \nL 48.78125 2.09375 \nQ 45.015625 0.34375 40.984375 -0.53125 \nQ 36.96875 -1.421875 32.421875 -1.421875 \nQ 20.0625 -1.421875 12.78125 6.34375 \nQ 5.515625 14.109375 5.515625 27.296875 \nQ 5.515625 40.671875 12.859375 48.328125 \nQ 20.21875 56 33.015625 56 \nQ 37.15625 56 41.109375 55.140625 \nQ 45.0625 54.296875 48.78125 52.59375 \nz\n\" id=\"DejaVuSans-99\"/>\n      <path d=\"M 54.890625 33.015625 \nL 54.890625 0 \nL 45.90625 0 \nL 45.90625 32.71875 \nQ 45.90625 40.484375 42.875 44.328125 \nQ 39.84375 48.1875 33.796875 48.1875 \nQ 26.515625 48.1875 22.3125 43.546875 \nQ 18.109375 38.921875 18.109375 30.90625 \nL 18.109375 0 \nL 9.078125 0 \nL 9.078125 75.984375 \nL 18.109375 75.984375 \nL 18.109375 46.1875 \nQ 21.34375 51.125 25.703125 53.5625 \nQ 30.078125 56 35.796875 56 \nQ 45.21875 56 50.046875 50.171875 \nQ 54.890625 44.34375 54.890625 33.015625 \nz\n\" id=\"DejaVuSans-104\"/>\n     </defs>\n     <g transform=\"translate(123.025 171.376563)scale(0.1 -0.1)\">\n      <use xlink:href=\"#DejaVuSans-101\"/>\n      <use x=\"61.523438\" xlink:href=\"#DejaVuSans-112\"/>\n      <use x=\"125\" xlink:href=\"#DejaVuSans-111\"/>\n      <use x=\"186.181641\" xlink:href=\"#DejaVuSans-99\"/>\n      <use x=\"241.162109\" xlink:href=\"#DejaVuSans-104\"/>\n     </g>\n    </g>\n   </g>\n   <g id=\"matplotlib.axis_2\">\n    <g id=\"ytick_1\">\n     <g id=\"line2d_11\">\n      <path clip-path=\"url(#pe177d995d6)\" d=\"M 40.603125 138.766633 \nL 235.903125 138.766633 \n\" style=\"fill:none;stroke:#b0b0b0;stroke-linecap:square;stroke-width:0.8;\"/>\n     </g>\n     <g id=\"line2d_12\">\n      <defs>\n       <path d=\"M 0 0 \nL -3.5 0 \n\" id=\"m501dabe5a4\" style=\"stroke:#000000;stroke-width:0.8;\"/>\n      </defs>\n      <g>\n       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"40.603125\" xlink:href=\"#m501dabe5a4\" y=\"138.766633\"/>\n      </g>\n     </g>\n     <g id=\"text_7\">\n      <!-- 15 -->\n      <g transform=\"translate(20.878125 142.565851)scale(0.1 -0.1)\">\n       <use xlink:href=\"#DejaVuSans-49\"/>\n       <use x=\"63.623047\" xlink:href=\"#DejaVuSans-53\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"ytick_2\">\n     <g id=\"line2d_13\">\n      <path clip-path=\"url(#pe177d995d6)\" d=\"M 40.603125 105.864485 \nL 235.903125 105.864485 \n\" style=\"fill:none;stroke:#b0b0b0;stroke-linecap:square;stroke-width:0.8;\"/>\n     </g>\n     <g id=\"line2d_14\">\n      <g>\n       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"40.603125\" xlink:href=\"#m501dabe5a4\" y=\"105.864485\"/>\n      </g>\n     </g>\n     <g id=\"text_8\">\n      <!-- 20 -->\n      <defs>\n       <path d=\"M 31.78125 66.40625 \nQ 24.171875 66.40625 20.328125 58.90625 \nQ 16.5 51.421875 16.5 36.375 \nQ 16.5 21.390625 20.328125 13.890625 \nQ 24.171875 6.390625 31.78125 6.390625 \nQ 39.453125 6.390625 43.28125 13.890625 \nQ 47.125 21.390625 47.125 36.375 \nQ 47.125 51.421875 43.28125 58.90625 \nQ 39.453125 66.40625 31.78125 66.40625 \nz\nM 31.78125 74.21875 \nQ 44.046875 74.21875 50.515625 64.515625 \nQ 56.984375 54.828125 56.984375 36.375 \nQ 56.984375 17.96875 50.515625 8.265625 \nQ 44.046875 -1.421875 31.78125 -1.421875 \nQ 19.53125 -1.421875 13.0625 8.265625 \nQ 6.59375 17.96875 6.59375 36.375 \nQ 6.59375 54.828125 13.0625 64.515625 \nQ 19.53125 74.21875 31.78125 74.21875 \nz\n\" id=\"DejaVuSans-48\"/>\n      </defs>\n      <g transform=\"translate(20.878125 109.663703)scale(0.1 -0.1)\">\n       <use xlink:href=\"#DejaVuSans-50\"/>\n       <use x=\"63.623047\" xlink:href=\"#DejaVuSans-48\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"ytick_3\">\n     <g id=\"line2d_15\">\n      <path clip-path=\"url(#pe177d995d6)\" d=\"M 40.603125 72.962337 \nL 235.903125 72.962337 \n\" style=\"fill:none;stroke:#b0b0b0;stroke-linecap:square;stroke-width:0.8;\"/>\n     </g>\n     <g id=\"line2d_16\">\n      <g>\n       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"40.603125\" xlink:href=\"#m501dabe5a4\" y=\"72.962337\"/>\n      </g>\n     </g>\n     <g id=\"text_9\">\n      <!-- 25 -->\n      <g transform=\"translate(20.878125 76.761556)scale(0.1 -0.1)\">\n       <use xlink:href=\"#DejaVuSans-50\"/>\n       <use x=\"63.623047\" xlink:href=\"#DejaVuSans-53\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"ytick_4\">\n     <g id=\"line2d_17\">\n      <path clip-path=\"url(#pe177d995d6)\" d=\"M 40.603125 40.060189 \nL 235.903125 40.060189 \n\" style=\"fill:none;stroke:#b0b0b0;stroke-linecap:square;stroke-width:0.8;\"/>\n     </g>\n     <g id=\"line2d_18\">\n      <g>\n       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"40.603125\" xlink:href=\"#m501dabe5a4\" y=\"40.060189\"/>\n      </g>\n     </g>\n     <g id=\"text_10\">\n      <!-- 30 -->\n      <g transform=\"translate(20.878125 43.859408)scale(0.1 -0.1)\">\n       <use xlink:href=\"#DejaVuSans-51\"/>\n       <use x=\"63.623047\" xlink:href=\"#DejaVuSans-48\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"text_11\">\n     <!-- loss -->\n     <defs>\n      <path d=\"M 9.421875 75.984375 \nL 18.40625 75.984375 \nL 18.40625 0 \nL 9.421875 0 \nz\n\" id=\"DejaVuSans-108\"/>\n      <path d=\"M 44.28125 53.078125 \nL 44.28125 44.578125 \nQ 40.484375 46.53125 36.375 47.5 \nQ 32.28125 48.484375 27.875 48.484375 \nQ 21.1875 48.484375 17.84375 46.4375 \nQ 14.5 44.390625 14.5 40.28125 \nQ 14.5 37.15625 16.890625 35.375 \nQ 19.28125 33.59375 26.515625 31.984375 \nL 29.59375 31.296875 \nQ 39.15625 29.25 43.1875 25.515625 \nQ 47.21875 21.78125 47.21875 15.09375 \nQ 47.21875 7.46875 41.1875 3.015625 \nQ 35.15625 -1.421875 24.609375 -1.421875 \nQ 20.21875 -1.421875 15.453125 -0.5625 \nQ 10.6875 0.296875 5.421875 2 \nL 5.421875 11.28125 \nQ 10.40625 8.6875 15.234375 7.390625 \nQ 20.0625 6.109375 24.8125 6.109375 \nQ 31.15625 6.109375 34.5625 8.28125 \nQ 37.984375 10.453125 37.984375 14.40625 \nQ 37.984375 18.0625 35.515625 20.015625 \nQ 33.0625 21.96875 24.703125 23.78125 \nL 21.578125 24.515625 \nQ 13.234375 26.265625 9.515625 29.90625 \nQ 5.8125 33.546875 5.8125 39.890625 \nQ 5.8125 47.609375 11.28125 51.796875 \nQ 16.75 56 26.8125 56 \nQ 31.78125 56 36.171875 55.265625 \nQ 40.578125 54.546875 44.28125 53.078125 \nz\n\" id=\"DejaVuSans-115\"/>\n     </defs>\n     <g transform=\"translate(14.798437 84.807812)rotate(-90)scale(0.1 -0.1)\">\n      <use xlink:href=\"#DejaVuSans-108\"/>\n      <use x=\"27.783203\" xlink:href=\"#DejaVuSans-111\"/>\n      <use x=\"88.964844\" xlink:href=\"#DejaVuSans-115\"/>\n      <use x=\"141.064453\" xlink:href=\"#DejaVuSans-115\"/>\n     </g>\n    </g>\n   </g>\n   <g id=\"line2d_19\">\n    <path clip-path=\"url(#pe177d995d6)\" d=\"M 40.603125 13.377273 \nL 89.428125 136.919094 \nL 138.253125 136.920317 \nL 187.078125 136.921478 \nL 235.903125 136.922727 \n\" style=\"fill:none;stroke:#1f77b4;stroke-linecap:square;stroke-width:1.5;\"/>\n   </g>\n   <g id=\"patch_3\">\n    <path d=\"M 40.603125 143.1 \nL 40.603125 7.2 \n\" style=\"fill:none;stroke:#000000;stroke-linecap:square;stroke-linejoin:miter;stroke-width:0.8;\"/>\n   </g>\n   <g id=\"patch_4\">\n    <path d=\"M 235.903125 143.1 \nL 235.903125 7.2 \n\" style=\"fill:none;stroke:#000000;stroke-linecap:square;stroke-linejoin:miter;stroke-width:0.8;\"/>\n   </g>\n   <g id=\"patch_5\">\n    <path d=\"M 40.603125 143.1 \nL 235.903125 143.1 \n\" style=\"fill:none;stroke:#000000;stroke-linecap:square;stroke-linejoin:miter;stroke-width:0.8;\"/>\n   </g>\n   <g id=\"patch_6\">\n    <path d=\"M 40.603125 7.2 \nL 235.903125 7.2 \n\" style=\"fill:none;stroke:#000000;stroke-linecap:square;stroke-linejoin:miter;stroke-width:0.8;\"/>\n   </g>\n  </g>\n </g>\n <defs>\n  <clipPath id=\"pe177d995d6\">\n   <rect height=\"135.9\" width=\"195.3\" x=\"40.603125\" y=\"7.2\"/>\n  </clipPath>\n </defs>\n</svg>\n",
            "text/plain": [
              "<Figure size 252x180 with 1 Axes>"
            ]
          },
          "metadata": {
            "needs_background": "light"
          },
          "output_type": "display_data"
        }
      ],
      "source": [
        "net = NWKernelRegression()\n",
        "loss = nn.MSELoss(reduction='none')\n",
        "trainer = torch.optim.SGD(net.parameters(),lr=0.5)\n",
        "animator = d2l.Animator(xlabel='epoch',ylabel='loss',xlim=[1,5])\n",
        "\n",
        "for epoch in range(5):\n",
        "    trainer.zero_grad()\n",
        "    l = loss(net(x_train,keys,values),y_train)\n",
        "    l.sum().backward()\n",
        "    trainer.step()\n",
        "    print(f'epoch{epoch + 1}, loss{float(l.sum()):.6f}')\n",
        "    animator.add(epoch + 1,float(l.sum()))"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "dwPrUM1TEaew"
      },
      "source": [
        "带噪声的数据训练结果不如非参数模型的平滑"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 267
        },
        "id": "Ka6ok93A9ty-",
        "outputId": "c4ef5c8b-67e4-493e-a869-59c1328810a0"
      },
      "outputs": [
        {
          "data": {
            "image/svg+xml": "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"no\"?>\n<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\"\n  \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">\n<!-- Created with matplotlib (https://matplotlib.org/) -->\n<svg height=\"184.455469pt\" version=\"1.1\" viewBox=\"0 0 248.301563 184.455469\" width=\"248.301563pt\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n <defs>\n  <style type=\"text/css\">\n*{stroke-linecap:butt;stroke-linejoin:round;}\n  </style>\n </defs>\n <g id=\"figure_1\">\n  <g id=\"patch_1\">\n   <path d=\"M 0 184.455469 \nL 248.301563 184.455469 \nL 248.301563 -0 \nL 0 -0 \nz\n\" style=\"fill:none;\"/>\n  </g>\n  <g id=\"axes_1\">\n   <g id=\"patch_2\">\n    <path d=\"M 42.620312 146.899219 \nL 237.920313 146.899219 \nL 237.920313 10.999219 \nL 42.620312 10.999219 \nz\n\" style=\"fill:#ffffff;\"/>\n   </g>\n   <g id=\"matplotlib.axis_1\">\n    <g id=\"xtick_1\">\n     <g id=\"line2d_1\">\n      <path clip-path=\"url(#p613c5d4eb7)\" d=\"M 42.620312 146.899219 \nL 42.620312 10.999219 \n\" style=\"fill:none;stroke:#b0b0b0;stroke-linecap:square;stroke-width:0.8;\"/>\n     </g>\n     <g id=\"line2d_2\">\n      <defs>\n       <path d=\"M 0 0 \nL 0 3.5 \n\" id=\"m691a236f3a\" style=\"stroke:#000000;stroke-width:0.8;\"/>\n      </defs>\n      <g>\n       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"42.620312\" xlink:href=\"#m691a236f3a\" y=\"146.899219\"/>\n      </g>\n     </g>\n     <g id=\"text_1\">\n      <!-- 0 -->\n      <defs>\n       <path d=\"M 31.78125 66.40625 \nQ 24.171875 66.40625 20.328125 58.90625 \nQ 16.5 51.421875 16.5 36.375 \nQ 16.5 21.390625 20.328125 13.890625 \nQ 24.171875 6.390625 31.78125 6.390625 \nQ 39.453125 6.390625 43.28125 13.890625 \nQ 47.125 21.390625 47.125 36.375 \nQ 47.125 51.421875 43.28125 58.90625 \nQ 39.453125 66.40625 31.78125 66.40625 \nz\nM 31.78125 74.21875 \nQ 44.046875 74.21875 50.515625 64.515625 \nQ 56.984375 54.828125 56.984375 36.375 \nQ 56.984375 17.96875 50.515625 8.265625 \nQ 44.046875 -1.421875 31.78125 -1.421875 \nQ 19.53125 -1.421875 13.0625 8.265625 \nQ 6.59375 17.96875 6.59375 36.375 \nQ 6.59375 54.828125 13.0625 64.515625 \nQ 19.53125 74.21875 31.78125 74.21875 \nz\n\" id=\"DejaVuSans-48\"/>\n      </defs>\n      <g transform=\"translate(39.439062 161.497656)scale(0.1 -0.1)\">\n       <use xlink:href=\"#DejaVuSans-48\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"xtick_2\">\n     <g id=\"line2d_3\">\n      <path clip-path=\"url(#p613c5d4eb7)\" d=\"M 81.680312 146.899219 \nL 81.680312 10.999219 \n\" style=\"fill:none;stroke:#b0b0b0;stroke-linecap:square;stroke-width:0.8;\"/>\n     </g>\n     <g id=\"line2d_4\">\n      <g>\n       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"81.680312\" xlink:href=\"#m691a236f3a\" y=\"146.899219\"/>\n      </g>\n     </g>\n     <g id=\"text_2\">\n      <!-- 1 -->\n      <defs>\n       <path d=\"M 12.40625 8.296875 \nL 28.515625 8.296875 \nL 28.515625 63.921875 \nL 10.984375 60.40625 \nL 10.984375 69.390625 \nL 28.421875 72.90625 \nL 38.28125 72.90625 \nL 38.28125 8.296875 \nL 54.390625 8.296875 \nL 54.390625 0 \nL 12.40625 0 \nz\n\" id=\"DejaVuSans-49\"/>\n      </defs>\n      <g transform=\"translate(78.499062 161.497656)scale(0.1 -0.1)\">\n       <use xlink:href=\"#DejaVuSans-49\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"xtick_3\">\n     <g id=\"line2d_5\">\n      <path clip-path=\"url(#p613c5d4eb7)\" d=\"M 120.740313 146.899219 \nL 120.740313 10.999219 \n\" style=\"fill:none;stroke:#b0b0b0;stroke-linecap:square;stroke-width:0.8;\"/>\n     </g>\n     <g id=\"line2d_6\">\n      <g>\n       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"120.740313\" xlink:href=\"#m691a236f3a\" y=\"146.899219\"/>\n      </g>\n     </g>\n     <g id=\"text_3\">\n      <!-- 2 -->\n      <defs>\n       <path d=\"M 19.1875 8.296875 \nL 53.609375 8.296875 \nL 53.609375 0 \nL 7.328125 0 \nL 7.328125 8.296875 \nQ 12.9375 14.109375 22.625 23.890625 \nQ 32.328125 33.6875 34.8125 36.53125 \nQ 39.546875 41.84375 41.421875 45.53125 \nQ 43.3125 49.21875 43.3125 52.78125 \nQ 43.3125 58.59375 39.234375 62.25 \nQ 35.15625 65.921875 28.609375 65.921875 \nQ 23.96875 65.921875 18.8125 64.3125 \nQ 13.671875 62.703125 7.8125 59.421875 \nL 7.8125 69.390625 \nQ 13.765625 71.78125 18.9375 73 \nQ 24.125 74.21875 28.421875 74.21875 \nQ 39.75 74.21875 46.484375 68.546875 \nQ 53.21875 62.890625 53.21875 53.421875 \nQ 53.21875 48.921875 51.53125 44.890625 \nQ 49.859375 40.875 45.40625 35.40625 \nQ 44.1875 33.984375 37.640625 27.21875 \nQ 31.109375 20.453125 19.1875 8.296875 \nz\n\" id=\"DejaVuSans-50\"/>\n      </defs>\n      <g transform=\"translate(117.559062 161.497656)scale(0.1 -0.1)\">\n       <use xlink:href=\"#DejaVuSans-50\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"xtick_4\">\n     <g id=\"line2d_7\">\n      <path clip-path=\"url(#p613c5d4eb7)\" d=\"M 159.800313 146.899219 \nL 159.800313 10.999219 \n\" style=\"fill:none;stroke:#b0b0b0;stroke-linecap:square;stroke-width:0.8;\"/>\n     </g>\n     <g id=\"line2d_8\">\n      <g>\n       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"159.800313\" xlink:href=\"#m691a236f3a\" y=\"146.899219\"/>\n      </g>\n     </g>\n     <g id=\"text_4\">\n      <!-- 3 -->\n      <defs>\n       <path d=\"M 40.578125 39.3125 \nQ 47.65625 37.796875 51.625 33 \nQ 55.609375 28.21875 55.609375 21.1875 \nQ 55.609375 10.40625 48.1875 4.484375 \nQ 40.765625 -1.421875 27.09375 -1.421875 \nQ 22.515625 -1.421875 17.65625 -0.515625 \nQ 12.796875 0.390625 7.625 2.203125 \nL 7.625 11.71875 \nQ 11.71875 9.328125 16.59375 8.109375 \nQ 21.484375 6.890625 26.8125 6.890625 \nQ 36.078125 6.890625 40.9375 10.546875 \nQ 45.796875 14.203125 45.796875 21.1875 \nQ 45.796875 27.640625 41.28125 31.265625 \nQ 36.765625 34.90625 28.71875 34.90625 \nL 20.21875 34.90625 \nL 20.21875 43.015625 \nL 29.109375 43.015625 \nQ 36.375 43.015625 40.234375 45.921875 \nQ 44.09375 48.828125 44.09375 54.296875 \nQ 44.09375 59.90625 40.109375 62.90625 \nQ 36.140625 65.921875 28.71875 65.921875 \nQ 24.65625 65.921875 20.015625 65.03125 \nQ 15.375 64.15625 9.8125 62.3125 \nL 9.8125 71.09375 \nQ 15.4375 72.65625 20.34375 73.4375 \nQ 25.25 74.21875 29.59375 74.21875 \nQ 40.828125 74.21875 47.359375 69.109375 \nQ 53.90625 64.015625 53.90625 55.328125 \nQ 53.90625 49.265625 50.4375 45.09375 \nQ 46.96875 40.921875 40.578125 39.3125 \nz\n\" id=\"DejaVuSans-51\"/>\n      </defs>\n      <g transform=\"translate(156.619063 161.497656)scale(0.1 -0.1)\">\n       <use xlink:href=\"#DejaVuSans-51\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"xtick_5\">\n     <g id=\"line2d_9\">\n      <path clip-path=\"url(#p613c5d4eb7)\" d=\"M 198.860313 146.899219 \nL 198.860313 10.999219 \n\" style=\"fill:none;stroke:#b0b0b0;stroke-linecap:square;stroke-width:0.8;\"/>\n     </g>\n     <g id=\"line2d_10\">\n      <g>\n       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"198.860313\" xlink:href=\"#m691a236f3a\" y=\"146.899219\"/>\n      </g>\n     </g>\n     <g id=\"text_5\">\n      <!-- 4 -->\n      <defs>\n       <path d=\"M 37.796875 64.3125 \nL 12.890625 25.390625 \nL 37.796875 25.390625 \nz\nM 35.203125 72.90625 \nL 47.609375 72.90625 \nL 47.609375 25.390625 \nL 58.015625 25.390625 \nL 58.015625 17.1875 \nL 47.609375 17.1875 \nL 47.609375 0 \nL 37.796875 0 \nL 37.796875 17.1875 \nL 4.890625 17.1875 \nL 4.890625 26.703125 \nz\n\" id=\"DejaVuSans-52\"/>\n      </defs>\n      <g transform=\"translate(195.679063 161.497656)scale(0.1 -0.1)\">\n       <use xlink:href=\"#DejaVuSans-52\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"xtick_6\">\n     <g id=\"line2d_11\">\n      <path clip-path=\"url(#p613c5d4eb7)\" d=\"M 237.920313 146.899219 \nL 237.920313 10.999219 \n\" style=\"fill:none;stroke:#b0b0b0;stroke-linecap:square;stroke-width:0.8;\"/>\n     </g>\n     <g id=\"line2d_12\">\n      <g>\n       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"237.920313\" xlink:href=\"#m691a236f3a\" y=\"146.899219\"/>\n      </g>\n     </g>\n     <g id=\"text_6\">\n      <!-- 5 -->\n      <defs>\n       <path d=\"M 10.796875 72.90625 \nL 49.515625 72.90625 \nL 49.515625 64.59375 \nL 19.828125 64.59375 \nL 19.828125 46.734375 \nQ 21.96875 47.46875 24.109375 47.828125 \nQ 26.265625 48.1875 28.421875 48.1875 \nQ 40.625 48.1875 47.75 41.5 \nQ 54.890625 34.8125 54.890625 23.390625 \nQ 54.890625 11.625 47.5625 5.09375 \nQ 40.234375 -1.421875 26.90625 -1.421875 \nQ 22.3125 -1.421875 17.546875 -0.640625 \nQ 12.796875 0.140625 7.71875 1.703125 \nL 7.71875 11.625 \nQ 12.109375 9.234375 16.796875 8.0625 \nQ 21.484375 6.890625 26.703125 6.890625 \nQ 35.15625 6.890625 40.078125 11.328125 \nQ 45.015625 15.765625 45.015625 23.390625 \nQ 45.015625 31 40.078125 35.4375 \nQ 35.15625 39.890625 26.703125 39.890625 \nQ 22.75 39.890625 18.8125 39.015625 \nQ 14.890625 38.140625 10.796875 36.28125 \nz\n\" id=\"DejaVuSans-53\"/>\n      </defs>\n      <g transform=\"translate(234.739063 161.497656)scale(0.1 -0.1)\">\n       <use xlink:href=\"#DejaVuSans-53\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"text_7\">\n     <!-- x -->\n     <defs>\n      <path d=\"M 54.890625 54.6875 \nL 35.109375 28.078125 \nL 55.90625 0 \nL 45.3125 0 \nL 29.390625 21.484375 \nL 13.484375 0 \nL 2.875 0 \nL 24.125 28.609375 \nL 4.6875 54.6875 \nL 15.28125 54.6875 \nL 29.78125 35.203125 \nL 44.28125 54.6875 \nz\n\" id=\"DejaVuSans-120\"/>\n     </defs>\n     <g transform=\"translate(137.310937 175.175781)scale(0.1 -0.1)\">\n      <use xlink:href=\"#DejaVuSans-120\"/>\n     </g>\n    </g>\n   </g>\n   <g id=\"matplotlib.axis_2\">\n    <g id=\"ytick_1\">\n     <g id=\"line2d_13\">\n      <path clip-path=\"url(#p613c5d4eb7)\" d=\"M 42.620312 146.899219 \nL 237.920313 146.899219 \n\" style=\"fill:none;stroke:#b0b0b0;stroke-linecap:square;stroke-width:0.8;\"/>\n     </g>\n     <g id=\"line2d_14\">\n      <defs>\n       <path d=\"M 0 0 \nL -3.5 0 \n\" id=\"m6c4bae3987\" style=\"stroke:#000000;stroke-width:0.8;\"/>\n      </defs>\n      <g>\n       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"42.620312\" xlink:href=\"#m6c4bae3987\" y=\"146.899219\"/>\n      </g>\n     </g>\n     <g id=\"text_8\">\n      <!-- −1 -->\n      <defs>\n       <path d=\"M 10.59375 35.5 \nL 73.1875 35.5 \nL 73.1875 27.203125 \nL 10.59375 27.203125 \nz\n\" id=\"DejaVuSans-8722\"/>\n      </defs>\n      <g transform=\"translate(20.878125 150.698437)scale(0.1 -0.1)\">\n       <use xlink:href=\"#DejaVuSans-8722\"/>\n       <use x=\"83.789062\" xlink:href=\"#DejaVuSans-49\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"ytick_2\">\n     <g id=\"line2d_15\">\n      <path clip-path=\"url(#p613c5d4eb7)\" d=\"M 42.620312 124.249219 \nL 237.920313 124.249219 \n\" style=\"fill:none;stroke:#b0b0b0;stroke-linecap:square;stroke-width:0.8;\"/>\n     </g>\n     <g id=\"line2d_16\">\n      <g>\n       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"42.620312\" xlink:href=\"#m6c4bae3987\" y=\"124.249219\"/>\n      </g>\n     </g>\n     <g id=\"text_9\">\n      <!-- 0 -->\n      <g transform=\"translate(29.257812 128.048437)scale(0.1 -0.1)\">\n       <use xlink:href=\"#DejaVuSans-48\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"ytick_3\">\n     <g id=\"line2d_17\">\n      <path clip-path=\"url(#p613c5d4eb7)\" d=\"M 42.620312 101.599219 \nL 237.920313 101.599219 \n\" style=\"fill:none;stroke:#b0b0b0;stroke-linecap:square;stroke-width:0.8;\"/>\n     </g>\n     <g id=\"line2d_18\">\n      <g>\n       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"42.620312\" xlink:href=\"#m6c4bae3987\" y=\"101.599219\"/>\n      </g>\n     </g>\n     <g id=\"text_10\">\n      <!-- 1 -->\n      <g transform=\"translate(29.257812 105.398437)scale(0.1 -0.1)\">\n       <use xlink:href=\"#DejaVuSans-49\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"ytick_4\">\n     <g id=\"line2d_19\">\n      <path clip-path=\"url(#p613c5d4eb7)\" d=\"M 42.620312 78.949219 \nL 237.920313 78.949219 \n\" style=\"fill:none;stroke:#b0b0b0;stroke-linecap:square;stroke-width:0.8;\"/>\n     </g>\n     <g id=\"line2d_20\">\n      <g>\n       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"42.620312\" xlink:href=\"#m6c4bae3987\" y=\"78.949219\"/>\n      </g>\n     </g>\n     <g id=\"text_11\">\n      <!-- 2 -->\n      <g transform=\"translate(29.257812 82.748437)scale(0.1 -0.1)\">\n       <use xlink:href=\"#DejaVuSans-50\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"ytick_5\">\n     <g id=\"line2d_21\">\n      <path clip-path=\"url(#p613c5d4eb7)\" d=\"M 42.620312 56.299219 \nL 237.920313 56.299219 \n\" style=\"fill:none;stroke:#b0b0b0;stroke-linecap:square;stroke-width:0.8;\"/>\n     </g>\n     <g id=\"line2d_22\">\n      <g>\n       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"42.620312\" xlink:href=\"#m6c4bae3987\" y=\"56.299219\"/>\n      </g>\n     </g>\n     <g id=\"text_12\">\n      <!-- 3 -->\n      <g transform=\"translate(29.257812 60.098437)scale(0.1 -0.1)\">\n       <use xlink:href=\"#DejaVuSans-51\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"ytick_6\">\n     <g id=\"line2d_23\">\n      <path clip-path=\"url(#p613c5d4eb7)\" d=\"M 42.620312 33.649219 \nL 237.920313 33.649219 \n\" style=\"fill:none;stroke:#b0b0b0;stroke-linecap:square;stroke-width:0.8;\"/>\n     </g>\n     <g id=\"line2d_24\">\n      <g>\n       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"42.620312\" xlink:href=\"#m6c4bae3987\" y=\"33.649219\"/>\n      </g>\n     </g>\n     <g id=\"text_13\">\n      <!-- 4 -->\n      <g transform=\"translate(29.257812 37.448437)scale(0.1 -0.1)\">\n       <use xlink:href=\"#DejaVuSans-52\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"ytick_7\">\n     <g id=\"line2d_25\">\n      <path clip-path=\"url(#p613c5d4eb7)\" d=\"M 42.620312 10.999219 \nL 237.920313 10.999219 \n\" style=\"fill:none;stroke:#b0b0b0;stroke-linecap:square;stroke-width:0.8;\"/>\n     </g>\n     <g id=\"line2d_26\">\n      <g>\n       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"42.620312\" xlink:href=\"#m6c4bae3987\" y=\"10.999219\"/>\n      </g>\n     </g>\n     <g id=\"text_14\">\n      <!-- 5 -->\n      <g transform=\"translate(29.257812 14.798437)scale(0.1 -0.1)\">\n       <use xlink:href=\"#DejaVuSans-53\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"text_15\">\n     <!-- y -->\n     <defs>\n      <path d=\"M 32.171875 -5.078125 \nQ 28.375 -14.84375 24.75 -17.8125 \nQ 21.140625 -20.796875 15.09375 -20.796875 \nL 7.90625 -20.796875 \nL 7.90625 -13.28125 \nL 13.1875 -13.28125 \nQ 16.890625 -13.28125 18.9375 -11.515625 \nQ 21 -9.765625 23.484375 -3.21875 \nL 25.09375 0.875 \nL 2.984375 54.6875 \nL 12.5 54.6875 \nL 29.59375 11.921875 \nL 46.6875 54.6875 \nL 56.203125 54.6875 \nz\n\" id=\"DejaVuSans-121\"/>\n     </defs>\n     <g transform=\"translate(14.798437 81.908594)rotate(-90)scale(0.1 -0.1)\">\n      <use xlink:href=\"#DejaVuSans-121\"/>\n     </g>\n    </g>\n   </g>\n   <g id=\"line2d_27\">\n    <path clip-path=\"url(#p613c5d4eb7)\" d=\"M 42.620312 124.249219 \nL 46.526313 116.136982 \nL 50.432313 108.999323 \nL 54.338313 102.217148 \nL 58.244313 95.726379 \nL 62.150312 89.522233 \nL 66.056313 83.619087 \nL 69.962312 78.038824 \nL 73.868313 72.806 \nL 77.774314 67.945395 \nL 81.680312 63.480584 \nL 85.586313 59.432954 \nL 89.492314 55.821098 \nL 93.398311 52.660258 \nL 97.304312 49.962036 \nL 101.210313 47.734078 \nL 105.116313 45.979911 \nL 109.022314 44.69881 \nL 112.928315 43.885737 \nL 116.834312 43.531371 \nL 120.740313 43.622105 \nL 124.646309 44.140188 \nL 128.552314 45.063873 \nL 132.458311 46.367563 \nL 136.364316 48.022135 \nL 140.270312 49.995107 \nL 144.176318 52.251038 \nL 148.082314 54.751808 \nL 151.98832 57.457039 \nL 155.894316 60.324422 \nL 159.800313 63.310193 \nL 163.706318 66.369546 \nL 167.612314 69.45704 \nL 171.518311 72.527086 \nL 175.424316 75.534393 \nL 179.330312 78.434371 \nL 183.236318 81.183652 \nL 187.142314 83.740416 \nL 191.048311 86.06491 \nL 194.954316 88.119776 \nL 198.860313 89.870412 \nL 202.766309 91.285368 \nL 206.672305 92.336626 \nL 210.57832 92.999866 \nL 214.484316 93.254719 \nL 218.390312 93.084986 \nL 222.296309 92.478756 \nL 226.202305 91.428572 \nL 230.10832 89.931453 \nL 234.014316 87.988973 \n\" style=\"fill:none;stroke:#1f77b4;stroke-linecap:square;stroke-width:1.5;\"/>\n   </g>\n   <g id=\"line2d_28\">\n    <path clip-path=\"url(#p613c5d4eb7)\" d=\"M 42.620312 86.928866 \nL 46.526313 87.795247 \nL 50.432313 89.268775 \nL 54.338313 91.241667 \nL 58.244313 91.330092 \nL 62.150312 84.553024 \nL 66.056313 85.251386 \nL 69.962312 84.833809 \nL 73.868313 78.160161 \nL 77.774314 69.216581 \nL 81.680312 65.005806 \nL 85.586313 50.213048 \nL 89.492314 39.694208 \nL 93.398311 58.7461 \nL 97.304312 56.364961 \nL 101.210313 41.799091 \nL 105.116313 38.741109 \nL 109.022314 45.117972 \nL 112.928315 45.884295 \nL 116.834312 38.905042 \nL 120.740313 40.47724 \nL 124.646309 49.357016 \nL 128.552314 47.579898 \nL 132.458311 46.34728 \nL 136.364316 40.352388 \nL 140.270312 32.543456 \nL 144.176318 47.498393 \nL 148.082314 54.170046 \nL 151.98832 54.17124 \nL 155.894316 54.371613 \nL 159.800313 74.323229 \nL 163.706318 74.646484 \nL 167.612314 68.434662 \nL 171.518311 61.917945 \nL 175.424316 66.648914 \nL 179.330312 69.261143 \nL 183.236318 85.439043 \nL 187.142314 93.921622 \nL 191.048311 86.435687 \nL 194.954316 73.756443 \nL 198.860313 97.896442 \nL 202.766309 101.709057 \nL 206.672305 90.67357 \nL 210.57832 83.107398 \nL 214.484316 82.991322 \nL 218.390312 82.866456 \nL 222.296309 76.914404 \nL 226.202305 77.001638 \nL 230.10832 78.322117 \nL 234.014316 80.744622 \n\" style=\"fill:none;stroke:#bf00bf;stroke-dasharray:5.55,2.4;stroke-dashoffset:0;stroke-width:1.5;\"/>\n   </g>\n   <g id=\"line2d_29\">\n    <defs>\n     <path d=\"M 0 3 \nC 0.795609 3 1.55874 2.683901 2.12132 2.12132 \nC 2.683901 1.55874 3 0.795609 3 0 \nC 3 -0.795609 2.683901 -1.55874 2.12132 -2.12132 \nC 1.55874 -2.683901 0.795609 -3 0 -3 \nC -0.795609 -3 -1.55874 -2.683901 -2.12132 -2.12132 \nC -2.683901 -1.55874 -3 -0.795609 -3 0 \nC -3 0.795609 -2.683901 1.55874 -2.12132 2.12132 \nC -1.55874 2.683901 -0.795609 3 0 3 \nz\n\" id=\"mf485ab24b5\" style=\"stroke:#ff7f0e;stroke-opacity:0.5;\"/>\n    </defs>\n    <g clip-path=\"url(#p613c5d4eb7)\">\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"57.227417\" xlink:href=\"#mf485ab24b5\" y=\"86.054806\"/>\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"58.094818\" xlink:href=\"#mf485ab24b5\" y=\"94.550419\"/>\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"58.378528\" xlink:href=\"#mf485ab24b5\" y=\"99.183761\"/>\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"61.559268\" xlink:href=\"#mf485ab24b5\" y=\"80.290842\"/>\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"61.669995\" xlink:href=\"#mf485ab24b5\" y=\"94.281191\"/>\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"62.106967\" xlink:href=\"#mf485ab24b5\" y=\"78.474019\"/>\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"63.50293\" xlink:href=\"#mf485ab24b5\" y=\"77.736592\"/>\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"66.629448\" xlink:href=\"#mf485ab24b5\" y=\"93.017694\"/>\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"67.547324\" xlink:href=\"#mf485ab24b5\" y=\"81.544259\"/>\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"74.548966\" xlink:href=\"#mf485ab24b5\" y=\"78.756935\"/>\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"79.19761\" xlink:href=\"#mf485ab24b5\" y=\"65.54637\"/>\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"82.758203\" xlink:href=\"#mf485ab24b5\" y=\"65.287226\"/>\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"87.728959\" xlink:href=\"#mf485ab24b5\" y=\"39.192585\"/>\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"96.636908\" xlink:href=\"#mf485ab24b5\" y=\"61.057534\"/>\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"100.850812\" xlink:href=\"#mf485ab24b5\" y=\"41.745807\"/>\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"103.226883\" xlink:href=\"#mf485ab24b5\" y=\"45.203176\"/>\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"105.008296\" xlink:href=\"#mf485ab24b5\" y=\"17.397591\"/>\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"105.19826\" xlink:href=\"#mf485ab24b5\" y=\"37.219494\"/>\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"105.274046\" xlink:href=\"#mf485ab24b5\" y=\"52.471025\"/>\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"107.624377\" xlink:href=\"#mf485ab24b5\" y=\"44.95717\"/>\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"110.088583\" xlink:href=\"#mf485ab24b5\" y=\"49.486896\"/>\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"112.502044\" xlink:href=\"#mf485ab24b5\" y=\"51.095799\"/>\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"115.543651\" xlink:href=\"#mf485ab24b5\" y=\"39.379707\"/>\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"116.068595\" xlink:href=\"#mf485ab24b5\" y=\"36.774131\"/>\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"120.220463\" xlink:href=\"#mf485ab24b5\" y=\"37.887896\"/>\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"124.697323\" xlink:href=\"#mf485ab24b5\" y=\"54.664325\"/>\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"126.683642\" xlink:href=\"#mf485ab24b5\" y=\"44.087228\"/>\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"128.566777\" xlink:href=\"#mf485ab24b5\" y=\"47.897666\"/>\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"132.243394\" xlink:href=\"#mf485ab24b5\" y=\"51.144141\"/>\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"134.251951\" xlink:href=\"#mf485ab24b5\" y=\"39.51685\"/>\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"134.784475\" xlink:href=\"#mf485ab24b5\" y=\"47.0668\"/>\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"138.165174\" xlink:href=\"#mf485ab24b5\" y=\"31.170827\"/>\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"149.407781\" xlink:href=\"#mf485ab24b5\" y=\"54.17124\"/>\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"165.238981\" xlink:href=\"#mf485ab24b5\" y=\"73.108734\"/>\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"166.60222\" xlink:href=\"#mf485ab24b5\" y=\"81.738185\"/>\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"168.585251\" xlink:href=\"#mf485ab24b5\" y=\"62.365814\"/>\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"169.344305\" xlink:href=\"#mf485ab24b5\" y=\"56.057247\"/>\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"175.803154\" xlink:href=\"#mf485ab24b5\" y=\"72.893974\"/>\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"177.333918\" xlink:href=\"#mf485ab24b5\" y=\"57.874025\"/>\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"182.188414\" xlink:href=\"#mf485ab24b5\" y=\"84.215918\"/>\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"186.843761\" xlink:href=\"#mf485ab24b5\" y=\"91.090521\"/>\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"189.515601\" xlink:href=\"#mf485ab24b5\" y=\"111.352993\"/>\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"190.372204\" xlink:href=\"#mf485ab24b5\" y=\"79.613862\"/>\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"192.53008\" xlink:href=\"#mf485ab24b5\" y=\"69.098679\"/>\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"203.411004\" xlink:href=\"#mf485ab24b5\" y=\"101.960855\"/>\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"209.29381\" xlink:href=\"#mf485ab24b5\" y=\"82.990244\"/>\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"229.549041\" xlink:href=\"#mf485ab24b5\" y=\"78.088074\"/>\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"229.834119\" xlink:href=\"#mf485ab24b5\" y=\"75.026041\"/>\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"232.208914\" xlink:href=\"#mf485ab24b5\" y=\"76.215161\"/>\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"232.414574\" xlink:href=\"#mf485ab24b5\" y=\"86.656578\"/>\n    </g>\n   </g>\n   <g id=\"patch_3\">\n    <path d=\"M 42.620312 146.899219 \nL 42.620312 10.999219 \n\" style=\"fill:none;stroke:#000000;stroke-linecap:square;stroke-linejoin:miter;stroke-width:0.8;\"/>\n   </g>\n   <g id=\"patch_4\">\n    <path d=\"M 237.920313 146.899219 \nL 237.920313 10.999219 \n\" style=\"fill:none;stroke:#000000;stroke-linecap:square;stroke-linejoin:miter;stroke-width:0.8;\"/>\n   </g>\n   <g id=\"patch_5\">\n    <path d=\"M 42.620312 146.899219 \nL 237.920313 146.899219 \n\" style=\"fill:none;stroke:#000000;stroke-linecap:square;stroke-linejoin:miter;stroke-width:0.8;\"/>\n   </g>\n   <g id=\"patch_6\">\n    <path d=\"M 42.620312 10.999219 \nL 237.920313 10.999219 \n\" style=\"fill:none;stroke:#000000;stroke-linecap:square;stroke-linejoin:miter;stroke-width:0.8;\"/>\n   </g>\n   <g id=\"legend_1\">\n    <g id=\"patch_7\">\n     <path d=\"M 173.58125 48.355469 \nL 230.920313 48.355469 \nQ 232.920313 48.355469 232.920313 46.355469 \nL 232.920313 17.999219 \nQ 232.920313 15.999219 230.920313 15.999219 \nL 173.58125 15.999219 \nQ 171.58125 15.999219 171.58125 17.999219 \nL 171.58125 46.355469 \nQ 171.58125 48.355469 173.58125 48.355469 \nz\n\" style=\"fill:#ffffff;opacity:0.8;stroke:#cccccc;stroke-linejoin:miter;\"/>\n    </g>\n    <g id=\"line2d_30\">\n     <path d=\"M 175.58125 24.097656 \nL 195.58125 24.097656 \n\" style=\"fill:none;stroke:#1f77b4;stroke-linecap:square;stroke-width:1.5;\"/>\n    </g>\n    <g id=\"line2d_31\"/>\n    <g id=\"text_16\">\n     <!-- Truth -->\n     <defs>\n      <path d=\"M -0.296875 72.90625 \nL 61.375 72.90625 \nL 61.375 64.59375 \nL 35.5 64.59375 \nL 35.5 0 \nL 25.59375 0 \nL 25.59375 64.59375 \nL -0.296875 64.59375 \nz\n\" id=\"DejaVuSans-84\"/>\n      <path d=\"M 41.109375 46.296875 \nQ 39.59375 47.171875 37.8125 47.578125 \nQ 36.03125 48 33.890625 48 \nQ 26.265625 48 22.1875 43.046875 \nQ 18.109375 38.09375 18.109375 28.8125 \nL 18.109375 0 \nL 9.078125 0 \nL 9.078125 54.6875 \nL 18.109375 54.6875 \nL 18.109375 46.1875 \nQ 20.953125 51.171875 25.484375 53.578125 \nQ 30.03125 56 36.53125 56 \nQ 37.453125 56 38.578125 55.875 \nQ 39.703125 55.765625 41.0625 55.515625 \nz\n\" id=\"DejaVuSans-114\"/>\n      <path d=\"M 8.5 21.578125 \nL 8.5 54.6875 \nL 17.484375 54.6875 \nL 17.484375 21.921875 \nQ 17.484375 14.15625 20.5 10.265625 \nQ 23.53125 6.390625 29.59375 6.390625 \nQ 36.859375 6.390625 41.078125 11.03125 \nQ 45.3125 15.671875 45.3125 23.6875 \nL 45.3125 54.6875 \nL 54.296875 54.6875 \nL 54.296875 0 \nL 45.3125 0 \nL 45.3125 8.40625 \nQ 42.046875 3.421875 37.71875 1 \nQ 33.40625 -1.421875 27.6875 -1.421875 \nQ 18.265625 -1.421875 13.375 4.4375 \nQ 8.5 10.296875 8.5 21.578125 \nz\nM 31.109375 56 \nz\n\" id=\"DejaVuSans-117\"/>\n      <path d=\"M 18.3125 70.21875 \nL 18.3125 54.6875 \nL 36.8125 54.6875 \nL 36.8125 47.703125 \nL 18.3125 47.703125 \nL 18.3125 18.015625 \nQ 18.3125 11.328125 20.140625 9.421875 \nQ 21.96875 7.515625 27.59375 7.515625 \nL 36.8125 7.515625 \nL 36.8125 0 \nL 27.59375 0 \nQ 17.1875 0 13.234375 3.875 \nQ 9.28125 7.765625 9.28125 18.015625 \nL 9.28125 47.703125 \nL 2.6875 47.703125 \nL 2.6875 54.6875 \nL 9.28125 54.6875 \nL 9.28125 70.21875 \nz\n\" id=\"DejaVuSans-116\"/>\n      <path d=\"M 54.890625 33.015625 \nL 54.890625 0 \nL 45.90625 0 \nL 45.90625 32.71875 \nQ 45.90625 40.484375 42.875 44.328125 \nQ 39.84375 48.1875 33.796875 48.1875 \nQ 26.515625 48.1875 22.3125 43.546875 \nQ 18.109375 38.921875 18.109375 30.90625 \nL 18.109375 0 \nL 9.078125 0 \nL 9.078125 75.984375 \nL 18.109375 75.984375 \nL 18.109375 46.1875 \nQ 21.34375 51.125 25.703125 53.5625 \nQ 30.078125 56 35.796875 56 \nQ 45.21875 56 50.046875 50.171875 \nQ 54.890625 44.34375 54.890625 33.015625 \nz\n\" id=\"DejaVuSans-104\"/>\n     </defs>\n     <g transform=\"translate(203.58125 27.597656)scale(0.1 -0.1)\">\n      <use xlink:href=\"#DejaVuSans-84\"/>\n      <use x=\"46.333984\" xlink:href=\"#DejaVuSans-114\"/>\n      <use x=\"87.447266\" xlink:href=\"#DejaVuSans-117\"/>\n      <use x=\"150.826172\" xlink:href=\"#DejaVuSans-116\"/>\n      <use x=\"190.035156\" xlink:href=\"#DejaVuSans-104\"/>\n     </g>\n    </g>\n    <g id=\"line2d_32\">\n     <path d=\"M 175.58125 38.775781 \nL 195.58125 38.775781 \n\" style=\"fill:none;stroke:#bf00bf;stroke-dasharray:5.55,2.4;stroke-dashoffset:0;stroke-width:1.5;\"/>\n    </g>\n    <g id=\"line2d_33\"/>\n    <g id=\"text_17\">\n     <!-- Pred -->\n     <defs>\n      <path d=\"M 19.671875 64.796875 \nL 19.671875 37.40625 \nL 32.078125 37.40625 \nQ 38.96875 37.40625 42.71875 40.96875 \nQ 46.484375 44.53125 46.484375 51.125 \nQ 46.484375 57.671875 42.71875 61.234375 \nQ 38.96875 64.796875 32.078125 64.796875 \nz\nM 9.8125 72.90625 \nL 32.078125 72.90625 \nQ 44.34375 72.90625 50.609375 67.359375 \nQ 56.890625 61.8125 56.890625 51.125 \nQ 56.890625 40.328125 50.609375 34.8125 \nQ 44.34375 29.296875 32.078125 29.296875 \nL 19.671875 29.296875 \nL 19.671875 0 \nL 9.8125 0 \nz\n\" id=\"DejaVuSans-80\"/>\n      <path d=\"M 56.203125 29.59375 \nL 56.203125 25.203125 \nL 14.890625 25.203125 \nQ 15.484375 15.921875 20.484375 11.0625 \nQ 25.484375 6.203125 34.421875 6.203125 \nQ 39.59375 6.203125 44.453125 7.46875 \nQ 49.3125 8.734375 54.109375 11.28125 \nL 54.109375 2.78125 \nQ 49.265625 0.734375 44.1875 -0.34375 \nQ 39.109375 -1.421875 33.890625 -1.421875 \nQ 20.796875 -1.421875 13.15625 6.1875 \nQ 5.515625 13.8125 5.515625 26.8125 \nQ 5.515625 40.234375 12.765625 48.109375 \nQ 20.015625 56 32.328125 56 \nQ 43.359375 56 49.78125 48.890625 \nQ 56.203125 41.796875 56.203125 29.59375 \nz\nM 47.21875 32.234375 \nQ 47.125 39.59375 43.09375 43.984375 \nQ 39.0625 48.390625 32.421875 48.390625 \nQ 24.90625 48.390625 20.390625 44.140625 \nQ 15.875 39.890625 15.1875 32.171875 \nz\n\" id=\"DejaVuSans-101\"/>\n      <path d=\"M 45.40625 46.390625 \nL 45.40625 75.984375 \nL 54.390625 75.984375 \nL 54.390625 0 \nL 45.40625 0 \nL 45.40625 8.203125 \nQ 42.578125 3.328125 38.25 0.953125 \nQ 33.9375 -1.421875 27.875 -1.421875 \nQ 17.96875 -1.421875 11.734375 6.484375 \nQ 5.515625 14.40625 5.515625 27.296875 \nQ 5.515625 40.1875 11.734375 48.09375 \nQ 17.96875 56 27.875 56 \nQ 33.9375 56 38.25 53.625 \nQ 42.578125 51.265625 45.40625 46.390625 \nz\nM 14.796875 27.296875 \nQ 14.796875 17.390625 18.875 11.75 \nQ 22.953125 6.109375 30.078125 6.109375 \nQ 37.203125 6.109375 41.296875 11.75 \nQ 45.40625 17.390625 45.40625 27.296875 \nQ 45.40625 37.203125 41.296875 42.84375 \nQ 37.203125 48.484375 30.078125 48.484375 \nQ 22.953125 48.484375 18.875 42.84375 \nQ 14.796875 37.203125 14.796875 27.296875 \nz\n\" id=\"DejaVuSans-100\"/>\n     </defs>\n     <g transform=\"translate(203.58125 42.275781)scale(0.1 -0.1)\">\n      <use xlink:href=\"#DejaVuSans-80\"/>\n      <use x=\"58.552734\" xlink:href=\"#DejaVuSans-114\"/>\n      <use x=\"97.416016\" xlink:href=\"#DejaVuSans-101\"/>\n      <use x=\"158.939453\" xlink:href=\"#DejaVuSans-100\"/>\n     </g>\n    </g>\n   </g>\n  </g>\n </g>\n <defs>\n  <clipPath id=\"p613c5d4eb7\">\n   <rect height=\"135.9\" width=\"195.3\" x=\"42.620312\" y=\"10.999219\"/>\n  </clipPath>\n </defs>\n</svg>\n",
            "text/plain": [
              "<Figure size 252x180 with 1 Axes>"
            ]
          },
          "metadata": {
            "needs_background": "light"
          },
          "output_type": "display_data"
        }
      ],
      "source": [
        "# keys的形状：（n_test，n_train），每一行包含着相同的训练输入（eg.相同的键）\n",
        "keys = x_train.repeat((n_test,1))\n",
        "# value的形状：（n_test，n_train)\n",
        "values = y_train.repeat((n_test,1))\n",
        "y_hat = net(x_test,keys,values).unsqueeze(1).detach()\n",
        "plot_kernel_reg(y_hat)"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 232
        },
        "id": "aI43gX-tAT1h",
        "outputId": "5af9eda8-b035-4493-8fb9-689978a8b5da"
      },
      "outputs": [
        {
          "data": {
            "image/svg+xml": "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"no\"?>\n<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\"\n  \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">\n<!-- Created with matplotlib (https://matplotlib.org/) -->\n<svg height=\"159.039469pt\" version=\"1.1\" viewBox=\"0 0 199.72075 159.039469\" width=\"199.72075pt\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n <defs>\n  <style type=\"text/css\">\n*{stroke-linecap:butt;stroke-linejoin:round;}\n  </style>\n </defs>\n <g id=\"figure_1\">\n  <g id=\"patch_1\">\n   <path d=\"M 0 159.039469 \nL 199.72075 159.039469 \nL 199.72075 0 \nL 0 0 \nz\n\" style=\"fill:none;\"/>\n  </g>\n  <g id=\"axes_1\">\n   <g id=\"patch_2\">\n    <path d=\"M 40.603125 121.483219 \nL 152.203125 121.483219 \nL 152.203125 9.883219 \nL 40.603125 9.883219 \nz\n\" style=\"fill:#ffffff;\"/>\n   </g>\n   <g clip-path=\"url(#p5ba5d1d57d)\">\n    <image height=\"112\" id=\"image12127421ea\" transform=\"scale(1 -1)translate(0 -112)\" width=\"112\" x=\"40.603125\" xlink:href=\"data:image/png;base64,\n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\" y=\"-9.483219\"/>\n   </g>\n   <g id=\"matplotlib.axis_1\">\n    <g id=\"xtick_1\">\n     <g id=\"line2d_1\">\n      <defs>\n       <path d=\"M 0 0 \nL 0 3.5 \n\" id=\"mf97618e38b\" style=\"stroke:#000000;stroke-width:0.8;\"/>\n      </defs>\n      <g>\n       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"41.719125\" xlink:href=\"#mf97618e38b\" y=\"121.483219\"/>\n      </g>\n     </g>\n     <g id=\"text_1\">\n      <!-- 0 -->\n      <defs>\n       <path d=\"M 31.78125 66.40625 \nQ 24.171875 66.40625 20.328125 58.90625 \nQ 16.5 51.421875 16.5 36.375 \nQ 16.5 21.390625 20.328125 13.890625 \nQ 24.171875 6.390625 31.78125 6.390625 \nQ 39.453125 6.390625 43.28125 13.890625 \nQ 47.125 21.390625 47.125 36.375 \nQ 47.125 51.421875 43.28125 58.90625 \nQ 39.453125 66.40625 31.78125 66.40625 \nz\nM 31.78125 74.21875 \nQ 44.046875 74.21875 50.515625 64.515625 \nQ 56.984375 54.828125 56.984375 36.375 \nQ 56.984375 17.96875 50.515625 8.265625 \nQ 44.046875 -1.421875 31.78125 -1.421875 \nQ 19.53125 -1.421875 13.0625 8.265625 \nQ 6.59375 17.96875 6.59375 36.375 \nQ 6.59375 54.828125 13.0625 64.515625 \nQ 19.53125 74.21875 31.78125 74.21875 \nz\n\" id=\"DejaVuSans-48\"/>\n      </defs>\n      <g transform=\"translate(38.537875 136.081656)scale(0.1 -0.1)\">\n       <use xlink:href=\"#DejaVuSans-48\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"xtick_2\">\n     <g id=\"line2d_2\">\n      <g>\n       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"86.359125\" xlink:href=\"#mf97618e38b\" y=\"121.483219\"/>\n      </g>\n     </g>\n     <g id=\"text_2\">\n      <!-- 20 -->\n      <defs>\n       <path d=\"M 19.1875 8.296875 \nL 53.609375 8.296875 \nL 53.609375 0 \nL 7.328125 0 \nL 7.328125 8.296875 \nQ 12.9375 14.109375 22.625 23.890625 \nQ 32.328125 33.6875 34.8125 36.53125 \nQ 39.546875 41.84375 41.421875 45.53125 \nQ 43.3125 49.21875 43.3125 52.78125 \nQ 43.3125 58.59375 39.234375 62.25 \nQ 35.15625 65.921875 28.609375 65.921875 \nQ 23.96875 65.921875 18.8125 64.3125 \nQ 13.671875 62.703125 7.8125 59.421875 \nL 7.8125 69.390625 \nQ 13.765625 71.78125 18.9375 73 \nQ 24.125 74.21875 28.421875 74.21875 \nQ 39.75 74.21875 46.484375 68.546875 \nQ 53.21875 62.890625 53.21875 53.421875 \nQ 53.21875 48.921875 51.53125 44.890625 \nQ 49.859375 40.875 45.40625 35.40625 \nQ 44.1875 33.984375 37.640625 27.21875 \nQ 31.109375 20.453125 19.1875 8.296875 \nz\n\" id=\"DejaVuSans-50\"/>\n      </defs>\n      <g transform=\"translate(79.996625 136.081656)scale(0.1 -0.1)\">\n       <use xlink:href=\"#DejaVuSans-50\"/>\n       <use x=\"63.623047\" xlink:href=\"#DejaVuSans-48\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"xtick_3\">\n     <g id=\"line2d_3\">\n      <g>\n       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"130.999125\" xlink:href=\"#mf97618e38b\" y=\"121.483219\"/>\n      </g>\n     </g>\n     <g id=\"text_3\">\n      <!-- 40 -->\n      <defs>\n       <path d=\"M 37.796875 64.3125 \nL 12.890625 25.390625 \nL 37.796875 25.390625 \nz\nM 35.203125 72.90625 \nL 47.609375 72.90625 \nL 47.609375 25.390625 \nL 58.015625 25.390625 \nL 58.015625 17.1875 \nL 47.609375 17.1875 \nL 47.609375 0 \nL 37.796875 0 \nL 37.796875 17.1875 \nL 4.890625 17.1875 \nL 4.890625 26.703125 \nz\n\" id=\"DejaVuSans-52\"/>\n      </defs>\n      <g transform=\"translate(124.636625 136.081656)scale(0.1 -0.1)\">\n       <use xlink:href=\"#DejaVuSans-52\"/>\n       <use x=\"63.623047\" xlink:href=\"#DejaVuSans-48\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"text_4\">\n     <!-- Sorted training inputs -->\n     <defs>\n      <path d=\"M 53.515625 70.515625 \nL 53.515625 60.890625 \nQ 47.90625 63.578125 42.921875 64.890625 \nQ 37.9375 66.21875 33.296875 66.21875 \nQ 25.25 66.21875 20.875 63.09375 \nQ 16.5 59.96875 16.5 54.203125 \nQ 16.5 49.359375 19.40625 46.890625 \nQ 22.3125 44.4375 30.421875 42.921875 \nL 36.375 41.703125 \nQ 47.40625 39.59375 52.65625 34.296875 \nQ 57.90625 29 57.90625 20.125 \nQ 57.90625 9.515625 50.796875 4.046875 \nQ 43.703125 -1.421875 29.984375 -1.421875 \nQ 24.8125 -1.421875 18.96875 -0.25 \nQ 13.140625 0.921875 6.890625 3.21875 \nL 6.890625 13.375 \nQ 12.890625 10.015625 18.65625 8.296875 \nQ 24.421875 6.59375 29.984375 6.59375 \nQ 38.421875 6.59375 43.015625 9.90625 \nQ 47.609375 13.234375 47.609375 19.390625 \nQ 47.609375 24.75 44.3125 27.78125 \nQ 41.015625 30.8125 33.5 32.328125 \nL 27.484375 33.5 \nQ 16.453125 35.6875 11.515625 40.375 \nQ 6.59375 45.0625 6.59375 53.421875 \nQ 6.59375 63.09375 13.40625 68.65625 \nQ 20.21875 74.21875 32.171875 74.21875 \nQ 37.3125 74.21875 42.625 73.28125 \nQ 47.953125 72.359375 53.515625 70.515625 \nz\n\" id=\"DejaVuSans-83\"/>\n      <path d=\"M 30.609375 48.390625 \nQ 23.390625 48.390625 19.1875 42.75 \nQ 14.984375 37.109375 14.984375 27.296875 \nQ 14.984375 17.484375 19.15625 11.84375 \nQ 23.34375 6.203125 30.609375 6.203125 \nQ 37.796875 6.203125 41.984375 11.859375 \nQ 46.1875 17.53125 46.1875 27.296875 \nQ 46.1875 37.015625 41.984375 42.703125 \nQ 37.796875 48.390625 30.609375 48.390625 \nz\nM 30.609375 56 \nQ 42.328125 56 49.015625 48.375 \nQ 55.71875 40.765625 55.71875 27.296875 \nQ 55.71875 13.875 49.015625 6.21875 \nQ 42.328125 -1.421875 30.609375 -1.421875 \nQ 18.84375 -1.421875 12.171875 6.21875 \nQ 5.515625 13.875 5.515625 27.296875 \nQ 5.515625 40.765625 12.171875 48.375 \nQ 18.84375 56 30.609375 56 \nz\n\" id=\"DejaVuSans-111\"/>\n      <path d=\"M 41.109375 46.296875 \nQ 39.59375 47.171875 37.8125 47.578125 \nQ 36.03125 48 33.890625 48 \nQ 26.265625 48 22.1875 43.046875 \nQ 18.109375 38.09375 18.109375 28.8125 \nL 18.109375 0 \nL 9.078125 0 \nL 9.078125 54.6875 \nL 18.109375 54.6875 \nL 18.109375 46.1875 \nQ 20.953125 51.171875 25.484375 53.578125 \nQ 30.03125 56 36.53125 56 \nQ 37.453125 56 38.578125 55.875 \nQ 39.703125 55.765625 41.0625 55.515625 \nz\n\" id=\"DejaVuSans-114\"/>\n      <path d=\"M 18.3125 70.21875 \nL 18.3125 54.6875 \nL 36.8125 54.6875 \nL 36.8125 47.703125 \nL 18.3125 47.703125 \nL 18.3125 18.015625 \nQ 18.3125 11.328125 20.140625 9.421875 \nQ 21.96875 7.515625 27.59375 7.515625 \nL 36.8125 7.515625 \nL 36.8125 0 \nL 27.59375 0 \nQ 17.1875 0 13.234375 3.875 \nQ 9.28125 7.765625 9.28125 18.015625 \nL 9.28125 47.703125 \nL 2.6875 47.703125 \nL 2.6875 54.6875 \nL 9.28125 54.6875 \nL 9.28125 70.21875 \nz\n\" id=\"DejaVuSans-116\"/>\n      <path d=\"M 56.203125 29.59375 \nL 56.203125 25.203125 \nL 14.890625 25.203125 \nQ 15.484375 15.921875 20.484375 11.0625 \nQ 25.484375 6.203125 34.421875 6.203125 \nQ 39.59375 6.203125 44.453125 7.46875 \nQ 49.3125 8.734375 54.109375 11.28125 \nL 54.109375 2.78125 \nQ 49.265625 0.734375 44.1875 -0.34375 \nQ 39.109375 -1.421875 33.890625 -1.421875 \nQ 20.796875 -1.421875 13.15625 6.1875 \nQ 5.515625 13.8125 5.515625 26.8125 \nQ 5.515625 40.234375 12.765625 48.109375 \nQ 20.015625 56 32.328125 56 \nQ 43.359375 56 49.78125 48.890625 \nQ 56.203125 41.796875 56.203125 29.59375 \nz\nM 47.21875 32.234375 \nQ 47.125 39.59375 43.09375 43.984375 \nQ 39.0625 48.390625 32.421875 48.390625 \nQ 24.90625 48.390625 20.390625 44.140625 \nQ 15.875 39.890625 15.1875 32.171875 \nz\n\" id=\"DejaVuSans-101\"/>\n      <path d=\"M 45.40625 46.390625 \nL 45.40625 75.984375 \nL 54.390625 75.984375 \nL 54.390625 0 \nL 45.40625 0 \nL 45.40625 8.203125 \nQ 42.578125 3.328125 38.25 0.953125 \nQ 33.9375 -1.421875 27.875 -1.421875 \nQ 17.96875 -1.421875 11.734375 6.484375 \nQ 5.515625 14.40625 5.515625 27.296875 \nQ 5.515625 40.1875 11.734375 48.09375 \nQ 17.96875 56 27.875 56 \nQ 33.9375 56 38.25 53.625 \nQ 42.578125 51.265625 45.40625 46.390625 \nz\nM 14.796875 27.296875 \nQ 14.796875 17.390625 18.875 11.75 \nQ 22.953125 6.109375 30.078125 6.109375 \nQ 37.203125 6.109375 41.296875 11.75 \nQ 45.40625 17.390625 45.40625 27.296875 \nQ 45.40625 37.203125 41.296875 42.84375 \nQ 37.203125 48.484375 30.078125 48.484375 \nQ 22.953125 48.484375 18.875 42.84375 \nQ 14.796875 37.203125 14.796875 27.296875 \nz\n\" id=\"DejaVuSans-100\"/>\n      <path id=\"DejaVuSans-32\"/>\n      <path d=\"M 34.28125 27.484375 \nQ 23.390625 27.484375 19.1875 25 \nQ 14.984375 22.515625 14.984375 16.5 \nQ 14.984375 11.71875 18.140625 8.90625 \nQ 21.296875 6.109375 26.703125 6.109375 \nQ 34.1875 6.109375 38.703125 11.40625 \nQ 43.21875 16.703125 43.21875 25.484375 \nL 43.21875 27.484375 \nz\nM 52.203125 31.203125 \nL 52.203125 0 \nL 43.21875 0 \nL 43.21875 8.296875 \nQ 40.140625 3.328125 35.546875 0.953125 \nQ 30.953125 -1.421875 24.3125 -1.421875 \nQ 15.921875 -1.421875 10.953125 3.296875 \nQ 6 8.015625 6 15.921875 \nQ 6 25.140625 12.171875 29.828125 \nQ 18.359375 34.515625 30.609375 34.515625 \nL 43.21875 34.515625 \nL 43.21875 35.40625 \nQ 43.21875 41.609375 39.140625 45 \nQ 35.0625 48.390625 27.6875 48.390625 \nQ 23 48.390625 18.546875 47.265625 \nQ 14.109375 46.140625 10.015625 43.890625 \nL 10.015625 52.203125 \nQ 14.9375 54.109375 19.578125 55.046875 \nQ 24.21875 56 28.609375 56 \nQ 40.484375 56 46.34375 49.84375 \nQ 52.203125 43.703125 52.203125 31.203125 \nz\n\" id=\"DejaVuSans-97\"/>\n      <path d=\"M 9.421875 54.6875 \nL 18.40625 54.6875 \nL 18.40625 0 \nL 9.421875 0 \nz\nM 9.421875 75.984375 \nL 18.40625 75.984375 \nL 18.40625 64.59375 \nL 9.421875 64.59375 \nz\n\" id=\"DejaVuSans-105\"/>\n      <path d=\"M 54.890625 33.015625 \nL 54.890625 0 \nL 45.90625 0 \nL 45.90625 32.71875 \nQ 45.90625 40.484375 42.875 44.328125 \nQ 39.84375 48.1875 33.796875 48.1875 \nQ 26.515625 48.1875 22.3125 43.546875 \nQ 18.109375 38.921875 18.109375 30.90625 \nL 18.109375 0 \nL 9.078125 0 \nL 9.078125 54.6875 \nL 18.109375 54.6875 \nL 18.109375 46.1875 \nQ 21.34375 51.125 25.703125 53.5625 \nQ 30.078125 56 35.796875 56 \nQ 45.21875 56 50.046875 50.171875 \nQ 54.890625 44.34375 54.890625 33.015625 \nz\n\" id=\"DejaVuSans-110\"/>\n      <path d=\"M 45.40625 27.984375 \nQ 45.40625 37.75 41.375 43.109375 \nQ 37.359375 48.484375 30.078125 48.484375 \nQ 22.859375 48.484375 18.828125 43.109375 \nQ 14.796875 37.75 14.796875 27.984375 \nQ 14.796875 18.265625 18.828125 12.890625 \nQ 22.859375 7.515625 30.078125 7.515625 \nQ 37.359375 7.515625 41.375 12.890625 \nQ 45.40625 18.265625 45.40625 27.984375 \nz\nM 54.390625 6.78125 \nQ 54.390625 -7.171875 48.1875 -13.984375 \nQ 42 -20.796875 29.203125 -20.796875 \nQ 24.46875 -20.796875 20.265625 -20.09375 \nQ 16.0625 -19.390625 12.109375 -17.921875 \nL 12.109375 -9.1875 \nQ 16.0625 -11.328125 19.921875 -12.34375 \nQ 23.78125 -13.375 27.78125 -13.375 \nQ 36.625 -13.375 41.015625 -8.765625 \nQ 45.40625 -4.15625 45.40625 5.171875 \nL 45.40625 9.625 \nQ 42.625 4.78125 38.28125 2.390625 \nQ 33.9375 0 27.875 0 \nQ 17.828125 0 11.671875 7.65625 \nQ 5.515625 15.328125 5.515625 27.984375 \nQ 5.515625 40.671875 11.671875 48.328125 \nQ 17.828125 56 27.875 56 \nQ 33.9375 56 38.28125 53.609375 \nQ 42.625 51.21875 45.40625 46.390625 \nL 45.40625 54.6875 \nL 54.390625 54.6875 \nz\n\" id=\"DejaVuSans-103\"/>\n      <path d=\"M 18.109375 8.203125 \nL 18.109375 -20.796875 \nL 9.078125 -20.796875 \nL 9.078125 54.6875 \nL 18.109375 54.6875 \nL 18.109375 46.390625 \nQ 20.953125 51.265625 25.265625 53.625 \nQ 29.59375 56 35.59375 56 \nQ 45.5625 56 51.78125 48.09375 \nQ 58.015625 40.1875 58.015625 27.296875 \nQ 58.015625 14.40625 51.78125 6.484375 \nQ 45.5625 -1.421875 35.59375 -1.421875 \nQ 29.59375 -1.421875 25.265625 0.953125 \nQ 20.953125 3.328125 18.109375 8.203125 \nz\nM 48.6875 27.296875 \nQ 48.6875 37.203125 44.609375 42.84375 \nQ 40.53125 48.484375 33.40625 48.484375 \nQ 26.265625 48.484375 22.1875 42.84375 \nQ 18.109375 37.203125 18.109375 27.296875 \nQ 18.109375 17.390625 22.1875 11.75 \nQ 26.265625 6.109375 33.40625 6.109375 \nQ 40.53125 6.109375 44.609375 11.75 \nQ 48.6875 17.390625 48.6875 27.296875 \nz\n\" id=\"DejaVuSans-112\"/>\n      <path d=\"M 8.5 21.578125 \nL 8.5 54.6875 \nL 17.484375 54.6875 \nL 17.484375 21.921875 \nQ 17.484375 14.15625 20.5 10.265625 \nQ 23.53125 6.390625 29.59375 6.390625 \nQ 36.859375 6.390625 41.078125 11.03125 \nQ 45.3125 15.671875 45.3125 23.6875 \nL 45.3125 54.6875 \nL 54.296875 54.6875 \nL 54.296875 0 \nL 45.3125 0 \nL 45.3125 8.40625 \nQ 42.046875 3.421875 37.71875 1 \nQ 33.40625 -1.421875 27.6875 -1.421875 \nQ 18.265625 -1.421875 13.375 4.4375 \nQ 8.5 10.296875 8.5 21.578125 \nz\nM 31.109375 56 \nz\n\" id=\"DejaVuSans-117\"/>\n      <path d=\"M 44.28125 53.078125 \nL 44.28125 44.578125 \nQ 40.484375 46.53125 36.375 47.5 \nQ 32.28125 48.484375 27.875 48.484375 \nQ 21.1875 48.484375 17.84375 46.4375 \nQ 14.5 44.390625 14.5 40.28125 \nQ 14.5 37.15625 16.890625 35.375 \nQ 19.28125 33.59375 26.515625 31.984375 \nL 29.59375 31.296875 \nQ 39.15625 29.25 43.1875 25.515625 \nQ 47.21875 21.78125 47.21875 15.09375 \nQ 47.21875 7.46875 41.1875 3.015625 \nQ 35.15625 -1.421875 24.609375 -1.421875 \nQ 20.21875 -1.421875 15.453125 -0.5625 \nQ 10.6875 0.296875 5.421875 2 \nL 5.421875 11.28125 \nQ 10.40625 8.6875 15.234375 7.390625 \nQ 20.0625 6.109375 24.8125 6.109375 \nQ 31.15625 6.109375 34.5625 8.28125 \nQ 37.984375 10.453125 37.984375 14.40625 \nQ 37.984375 18.0625 35.515625 20.015625 \nQ 33.0625 21.96875 24.703125 23.78125 \nL 21.578125 24.515625 \nQ 13.234375 26.265625 9.515625 29.90625 \nQ 5.8125 33.546875 5.8125 39.890625 \nQ 5.8125 47.609375 11.28125 51.796875 \nQ 16.75 56 26.8125 56 \nQ 31.78125 56 36.171875 55.265625 \nQ 40.578125 54.546875 44.28125 53.078125 \nz\n\" id=\"DejaVuSans-115\"/>\n     </defs>\n     <g transform=\"translate(41.889844 149.759781)scale(0.1 -0.1)\">\n      <use xlink:href=\"#DejaVuSans-83\"/>\n      <use x=\"63.476562\" xlink:href=\"#DejaVuSans-111\"/>\n      <use x=\"124.658203\" xlink:href=\"#DejaVuSans-114\"/>\n      <use x=\"165.771484\" xlink:href=\"#DejaVuSans-116\"/>\n      <use x=\"204.980469\" xlink:href=\"#DejaVuSans-101\"/>\n      <use x=\"266.503906\" xlink:href=\"#DejaVuSans-100\"/>\n      <use x=\"329.980469\" xlink:href=\"#DejaVuSans-32\"/>\n      <use x=\"361.767578\" xlink:href=\"#DejaVuSans-116\"/>\n      <use x=\"400.976562\" xlink:href=\"#DejaVuSans-114\"/>\n      <use x=\"442.089844\" xlink:href=\"#DejaVuSans-97\"/>\n      <use x=\"503.369141\" xlink:href=\"#DejaVuSans-105\"/>\n      <use x=\"531.152344\" xlink:href=\"#DejaVuSans-110\"/>\n      <use x=\"594.53125\" xlink:href=\"#DejaVuSans-105\"/>\n      <use x=\"622.314453\" xlink:href=\"#DejaVuSans-110\"/>\n      <use x=\"685.693359\" xlink:href=\"#DejaVuSans-103\"/>\n      <use x=\"749.169922\" xlink:href=\"#DejaVuSans-32\"/>\n      <use x=\"780.957031\" xlink:href=\"#DejaVuSans-105\"/>\n      <use x=\"808.740234\" xlink:href=\"#DejaVuSans-110\"/>\n      <use x=\"872.119141\" xlink:href=\"#DejaVuSans-112\"/>\n      <use x=\"935.595703\" xlink:href=\"#DejaVuSans-117\"/>\n      <use x=\"998.974609\" xlink:href=\"#DejaVuSans-116\"/>\n      <use x=\"1038.183594\" xlink:href=\"#DejaVuSans-115\"/>\n     </g>\n    </g>\n   </g>\n   <g id=\"matplotlib.axis_2\">\n    <g id=\"ytick_1\">\n     <g id=\"line2d_4\">\n      <defs>\n       <path d=\"M 0 0 \nL -3.5 0 \n\" id=\"m9b87f4de8c\" style=\"stroke:#000000;stroke-width:0.8;\"/>\n      </defs>\n      <g>\n       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"40.603125\" xlink:href=\"#m9b87f4de8c\" y=\"10.999219\"/>\n      </g>\n     </g>\n     <g id=\"text_5\">\n      <!-- 0 -->\n      <g transform=\"translate(27.240625 14.798437)scale(0.1 -0.1)\">\n       <use xlink:href=\"#DejaVuSans-48\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"ytick_2\">\n     <g id=\"line2d_5\">\n      <g>\n       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"40.603125\" xlink:href=\"#m9b87f4de8c\" y=\"33.319219\"/>\n      </g>\n     </g>\n     <g id=\"text_6\">\n      <!-- 10 -->\n      <defs>\n       <path d=\"M 12.40625 8.296875 \nL 28.515625 8.296875 \nL 28.515625 63.921875 \nL 10.984375 60.40625 \nL 10.984375 69.390625 \nL 28.421875 72.90625 \nL 38.28125 72.90625 \nL 38.28125 8.296875 \nL 54.390625 8.296875 \nL 54.390625 0 \nL 12.40625 0 \nz\n\" id=\"DejaVuSans-49\"/>\n      </defs>\n      <g transform=\"translate(20.878125 37.118437)scale(0.1 -0.1)\">\n       <use xlink:href=\"#DejaVuSans-49\"/>\n       <use x=\"63.623047\" xlink:href=\"#DejaVuSans-48\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"ytick_3\">\n     <g id=\"line2d_6\">\n      <g>\n       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"40.603125\" xlink:href=\"#m9b87f4de8c\" y=\"55.639219\"/>\n      </g>\n     </g>\n     <g id=\"text_7\">\n      <!-- 20 -->\n      <g transform=\"translate(20.878125 59.438437)scale(0.1 -0.1)\">\n       <use xlink:href=\"#DejaVuSans-50\"/>\n       <use x=\"63.623047\" xlink:href=\"#DejaVuSans-48\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"ytick_4\">\n     <g id=\"line2d_7\">\n      <g>\n       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"40.603125\" xlink:href=\"#m9b87f4de8c\" y=\"77.959219\"/>\n      </g>\n     </g>\n     <g id=\"text_8\">\n      <!-- 30 -->\n      <defs>\n       <path d=\"M 40.578125 39.3125 \nQ 47.65625 37.796875 51.625 33 \nQ 55.609375 28.21875 55.609375 21.1875 \nQ 55.609375 10.40625 48.1875 4.484375 \nQ 40.765625 -1.421875 27.09375 -1.421875 \nQ 22.515625 -1.421875 17.65625 -0.515625 \nQ 12.796875 0.390625 7.625 2.203125 \nL 7.625 11.71875 \nQ 11.71875 9.328125 16.59375 8.109375 \nQ 21.484375 6.890625 26.8125 6.890625 \nQ 36.078125 6.890625 40.9375 10.546875 \nQ 45.796875 14.203125 45.796875 21.1875 \nQ 45.796875 27.640625 41.28125 31.265625 \nQ 36.765625 34.90625 28.71875 34.90625 \nL 20.21875 34.90625 \nL 20.21875 43.015625 \nL 29.109375 43.015625 \nQ 36.375 43.015625 40.234375 45.921875 \nQ 44.09375 48.828125 44.09375 54.296875 \nQ 44.09375 59.90625 40.109375 62.90625 \nQ 36.140625 65.921875 28.71875 65.921875 \nQ 24.65625 65.921875 20.015625 65.03125 \nQ 15.375 64.15625 9.8125 62.3125 \nL 9.8125 71.09375 \nQ 15.4375 72.65625 20.34375 73.4375 \nQ 25.25 74.21875 29.59375 74.21875 \nQ 40.828125 74.21875 47.359375 69.109375 \nQ 53.90625 64.015625 53.90625 55.328125 \nQ 53.90625 49.265625 50.4375 45.09375 \nQ 46.96875 40.921875 40.578125 39.3125 \nz\n\" id=\"DejaVuSans-51\"/>\n      </defs>\n      <g transform=\"translate(20.878125 81.758437)scale(0.1 -0.1)\">\n       <use xlink:href=\"#DejaVuSans-51\"/>\n       <use x=\"63.623047\" xlink:href=\"#DejaVuSans-48\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"ytick_5\">\n     <g id=\"line2d_8\">\n      <g>\n       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"40.603125\" xlink:href=\"#m9b87f4de8c\" y=\"100.279219\"/>\n      </g>\n     </g>\n     <g id=\"text_9\">\n      <!-- 40 -->\n      <g transform=\"translate(20.878125 104.078437)scale(0.1 -0.1)\">\n       <use xlink:href=\"#DejaVuSans-52\"/>\n       <use x=\"63.623047\" xlink:href=\"#DejaVuSans-48\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"text_10\">\n     <!-- Sorted testing input -->\n     <g transform=\"translate(14.798438 115.555875)rotate(-90)scale(0.1 -0.1)\">\n      <use xlink:href=\"#DejaVuSans-83\"/>\n      <use x=\"63.476562\" xlink:href=\"#DejaVuSans-111\"/>\n      <use x=\"124.658203\" xlink:href=\"#DejaVuSans-114\"/>\n      <use x=\"165.771484\" xlink:href=\"#DejaVuSans-116\"/>\n      <use x=\"204.980469\" xlink:href=\"#DejaVuSans-101\"/>\n      <use x=\"266.503906\" xlink:href=\"#DejaVuSans-100\"/>\n      <use x=\"329.980469\" xlink:href=\"#DejaVuSans-32\"/>\n      <use x=\"361.767578\" xlink:href=\"#DejaVuSans-116\"/>\n      <use x=\"400.976562\" xlink:href=\"#DejaVuSans-101\"/>\n      <use x=\"462.5\" xlink:href=\"#DejaVuSans-115\"/>\n      <use x=\"514.599609\" xlink:href=\"#DejaVuSans-116\"/>\n      <use x=\"553.808594\" xlink:href=\"#DejaVuSans-105\"/>\n      <use x=\"581.591797\" xlink:href=\"#DejaVuSans-110\"/>\n      <use x=\"644.970703\" xlink:href=\"#DejaVuSans-103\"/>\n      <use x=\"708.447266\" xlink:href=\"#DejaVuSans-32\"/>\n      <use x=\"740.234375\" xlink:href=\"#DejaVuSans-105\"/>\n      <use x=\"768.017578\" xlink:href=\"#DejaVuSans-110\"/>\n      <use x=\"831.396484\" xlink:href=\"#DejaVuSans-112\"/>\n      <use x=\"894.873047\" xlink:href=\"#DejaVuSans-117\"/>\n      <use x=\"958.251953\" xlink:href=\"#DejaVuSans-116\"/>\n     </g>\n    </g>\n   </g>\n   <g id=\"patch_3\">\n    <path d=\"M 40.603125 121.483219 \nL 40.603125 9.883219 \n\" style=\"fill:none;stroke:#000000;stroke-linecap:square;stroke-linejoin:miter;stroke-width:0.8;\"/>\n   </g>\n   <g id=\"patch_4\">\n    <path d=\"M 152.203125 121.483219 \nL 152.203125 9.883219 \n\" style=\"fill:none;stroke:#000000;stroke-linecap:square;stroke-linejoin:miter;stroke-width:0.8;\"/>\n   </g>\n   <g id=\"patch_5\">\n    <path d=\"M 40.603125 121.483219 \nL 152.203125 121.483219 \n\" style=\"fill:none;stroke:#000000;stroke-linecap:square;stroke-linejoin:miter;stroke-width:0.8;\"/>\n   </g>\n   <g id=\"patch_6\">\n    <path d=\"M 40.603125 9.883219 \nL 152.203125 9.883219 \n\" style=\"fill:none;stroke:#000000;stroke-linecap:square;stroke-linejoin:miter;stroke-width:0.8;\"/>\n   </g>\n  </g>\n  <g id=\"axes_2\">\n   <g id=\"patch_7\">\n    <path clip-path=\"url(#pf80f393a4e)\" d=\"M 159.178125 106.453219 \nL 159.178125 106.134703 \nL 159.178125 25.231734 \nL 159.178125 24.913219 \nL 163.255125 24.913219 \nL 163.255125 25.231734 \nL 163.255125 106.134703 \nL 163.255125 106.453219 \nz\n\" style=\"fill:#ffffff;stroke:#ffffff;stroke-linejoin:miter;stroke-width:0.01;\"/>\n   </g>\n   <image height=\"81\" id=\"image8cc3c5e2d6\" transform=\"scale(1 -1)translate(0 -81)\" width=\"4\" x=\"159\" xlink:href=\"data:image/png;base64,\niVBORw0KGgoAAAANSUhEUgAAAAQAAABRCAYAAAD1sgc6AAAABHNCSVQICAgIfAhkiAAAAJxJREFUOI2dkjsOwlAQAx8S9z8pFRXslxbGkSyRcjS2N1Fu+3zs+XruZ/oADAGM1UiZiC9VUAnQWNl8G8N3iLHNSEkk3IpGvEEgdwRn/dv6FQ9SPiF/hz9K2SHGBkFxNuUOBybHGFpq7+hCaff+gmoaBUMiKaUExUjblRpGlrMERYDVC0MjRwzXIXcET78wUBpiELyklCB4qdzB0g/+a8q1SIPaUQAAAABJRU5ErkJggg==\" y=\"-25\"/>\n   <g id=\"matplotlib.axis_3\"/>\n   <g id=\"matplotlib.axis_4\">\n    <g id=\"ytick_6\">\n     <g id=\"line2d_9\">\n      <defs>\n       <path d=\"M 0 0 \nL 3.5 0 \n\" id=\"m400edc83fc\" style=\"stroke:#000000;stroke-width:0.8;\"/>\n      </defs>\n      <g>\n       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"163.255125\" xlink:href=\"#m400edc83fc\" y=\"106.453219\"/>\n      </g>\n     </g>\n     <g id=\"text_11\">\n      <!-- 0.00 -->\n      <defs>\n       <path d=\"M 10.6875 12.40625 \nL 21 12.40625 \nL 21 0 \nL 10.6875 0 \nz\n\" id=\"DejaVuSans-46\"/>\n      </defs>\n      <g transform=\"translate(170.255125 110.252437)scale(0.1 -0.1)\">\n       <use xlink:href=\"#DejaVuSans-48\"/>\n       <use x=\"63.623047\" xlink:href=\"#DejaVuSans-46\"/>\n       <use x=\"95.410156\" xlink:href=\"#DejaVuSans-48\"/>\n       <use x=\"159.033203\" xlink:href=\"#DejaVuSans-48\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"ytick_7\">\n     <g id=\"line2d_10\">\n      <g>\n       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"163.255125\" xlink:href=\"#m400edc83fc\" y=\"86.068219\"/>\n      </g>\n     </g>\n     <g id=\"text_12\">\n      <!-- 0.25 -->\n      <defs>\n       <path d=\"M 10.796875 72.90625 \nL 49.515625 72.90625 \nL 49.515625 64.59375 \nL 19.828125 64.59375 \nL 19.828125 46.734375 \nQ 21.96875 47.46875 24.109375 47.828125 \nQ 26.265625 48.1875 28.421875 48.1875 \nQ 40.625 48.1875 47.75 41.5 \nQ 54.890625 34.8125 54.890625 23.390625 \nQ 54.890625 11.625 47.5625 5.09375 \nQ 40.234375 -1.421875 26.90625 -1.421875 \nQ 22.3125 -1.421875 17.546875 -0.640625 \nQ 12.796875 0.140625 7.71875 1.703125 \nL 7.71875 11.625 \nQ 12.109375 9.234375 16.796875 8.0625 \nQ 21.484375 6.890625 26.703125 6.890625 \nQ 35.15625 6.890625 40.078125 11.328125 \nQ 45.015625 15.765625 45.015625 23.390625 \nQ 45.015625 31 40.078125 35.4375 \nQ 35.15625 39.890625 26.703125 39.890625 \nQ 22.75 39.890625 18.8125 39.015625 \nQ 14.890625 38.140625 10.796875 36.28125 \nz\n\" id=\"DejaVuSans-53\"/>\n      </defs>\n      <g transform=\"translate(170.255125 89.867437)scale(0.1 -0.1)\">\n       <use xlink:href=\"#DejaVuSans-48\"/>\n       <use x=\"63.623047\" xlink:href=\"#DejaVuSans-46\"/>\n       <use x=\"95.410156\" xlink:href=\"#DejaVuSans-50\"/>\n       <use x=\"159.033203\" xlink:href=\"#DejaVuSans-53\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"ytick_8\">\n     <g id=\"line2d_11\">\n      <g>\n       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"163.255125\" xlink:href=\"#m400edc83fc\" y=\"65.683219\"/>\n      </g>\n     </g>\n     <g id=\"text_13\">\n      <!-- 0.50 -->\n      <g transform=\"translate(170.255125 69.482437)scale(0.1 -0.1)\">\n       <use xlink:href=\"#DejaVuSans-48\"/>\n       <use x=\"63.623047\" xlink:href=\"#DejaVuSans-46\"/>\n       <use x=\"95.410156\" xlink:href=\"#DejaVuSans-53\"/>\n       <use x=\"159.033203\" xlink:href=\"#DejaVuSans-48\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"ytick_9\">\n     <g id=\"line2d_12\">\n      <g>\n       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"163.255125\" xlink:href=\"#m400edc83fc\" y=\"45.298219\"/>\n      </g>\n     </g>\n     <g id=\"text_14\">\n      <!-- 0.75 -->\n      <defs>\n       <path d=\"M 8.203125 72.90625 \nL 55.078125 72.90625 \nL 55.078125 68.703125 \nL 28.609375 0 \nL 18.3125 0 \nL 43.21875 64.59375 \nL 8.203125 64.59375 \nz\n\" id=\"DejaVuSans-55\"/>\n      </defs>\n      <g transform=\"translate(170.255125 49.097437)scale(0.1 -0.1)\">\n       <use xlink:href=\"#DejaVuSans-48\"/>\n       <use x=\"63.623047\" xlink:href=\"#DejaVuSans-46\"/>\n       <use x=\"95.410156\" xlink:href=\"#DejaVuSans-55\"/>\n       <use x=\"159.033203\" xlink:href=\"#DejaVuSans-53\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"ytick_10\">\n     <g id=\"line2d_13\">\n      <g>\n       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"163.255125\" xlink:href=\"#m400edc83fc\" y=\"24.913219\"/>\n      </g>\n     </g>\n     <g id=\"text_15\">\n      <!-- 1.00 -->\n      <g transform=\"translate(170.255125 28.712437)scale(0.1 -0.1)\">\n       <use xlink:href=\"#DejaVuSans-49\"/>\n       <use x=\"63.623047\" xlink:href=\"#DejaVuSans-46\"/>\n       <use x=\"95.410156\" xlink:href=\"#DejaVuSans-48\"/>\n       <use x=\"159.033203\" xlink:href=\"#DejaVuSans-48\"/>\n      </g>\n     </g>\n    </g>\n   </g>\n   <g id=\"patch_8\">\n    <path d=\"M 159.178125 106.453219 \nL 159.178125 106.134703 \nL 159.178125 25.231734 \nL 159.178125 24.913219 \nL 163.255125 24.913219 \nL 163.255125 25.231734 \nL 163.255125 106.134703 \nL 163.255125 106.453219 \nz\n\" style=\"fill:none;stroke:#000000;stroke-linejoin:miter;stroke-width:0.8;\"/>\n   </g>\n  </g>\n </g>\n <defs>\n  <clipPath id=\"p5ba5d1d57d\">\n   <rect height=\"111.6\" width=\"111.6\" x=\"40.603125\" y=\"9.883219\"/>\n  </clipPath>\n  <clipPath id=\"pf80f393a4e\">\n   <rect height=\"81.54\" width=\"4.077\" x=\"159.178125\" y=\"24.913219\"/>\n  </clipPath>\n </defs>\n</svg>\n",
            "text/plain": [
              "<Figure size 180x180 with 2 Axes>"
            ]
          },
          "metadata": {
            "needs_background": "light"
          },
          "output_type": "display_data"
        }
      ],
      "source": [
        "show_heatmaps(net.attention_weights.unsqueeze(0).unsqueeze(0),xlabel='Sorted training inputs',ylabel='Sorted testing input')"
      ]
    }
  ],
  "metadata": {
    "accelerator": "GPU",
    "colab": {
      "name": "Attention.ipynb",
      "provenance": []
    },
    "kernelspec": {
      "display_name": "Python 3",
      "name": "python3"
    },
    "language_info": {
      "name": "python"
    }
  },
  "nbformat": 4,
  "nbformat_minor": 0
}
